Browse our Products

Aspose.GIS for for Python via .NET 24.12 Release Notes

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
GISPYTHON-2Automatic calculation of map size for quick exportFeature
GISPYTHON-3Aspose.GIS didn’t copy the tags when loaded nodes from one OSM to another oneBug
GISPYTHON-4Aspose.GIS uses System Regional Settings for the saving of OSM Map that leads to , instead on . in XML Lon and Lat XML Node AttributesBug

Public API and Backward Incompatible Changes

Following members have been added:

  • M:Aspose.Gis.Rendering.Map.#ctor

Following members have been removed:

  • None

Usage examples:

GISPYTHON-2. Automatic calculation of map size for quick export

        input1 = "world1.jpg"
        input2 = "ug.shp"

        output = "result1071.jpg"

        # Open the JPEG layer
        layer_1 = Drivers.jpeg_w.open_layer(input1)

        # Open the Shapefile layer
        layer_2 = Drivers.shapefile.open_layer(input2)

        # Create a new Map instance
        map_instance = Map()

        # Add the layers to the map
        map_instance.add(layer_1, self.GetGrayBand(), False)
        map_instance.add(layer_2)

        # Render the map to a JPEG file
        map_instance.render(output, Renderers.jpeg)

GISPYTHON-3. Aspose.GIS didn’t copy the tags when loaded nodes from one OSM to another one

        # Set up the OSM XML options
        options = OsmXmlOptions()
        options.write_common_attributes = True
        options.report_common_attributes = True

        input = "fountain.osm"
        output = "result1742.xml"

        # Create a new layer with the specified options
        with VectorLayer.create(output, Drivers.osm_xml, options) as new_layer:
            # Open the existing layer
            with VectorLayer.open(input, Drivers.osm_xml, options) as layer:
                # Add each feature from the existing layer to the new layer
                for feature in layer:
                    new_layer.add(feature)

GISPYTHON-4. Aspose.GIS uses System Regional Settings for the saving of OSM Map that leads to , instead on . in XML Lon and Lat XML Node Attributes

  # Set up the OSM XML options
        options = OsmXmlOptions()
        options.write_common_attributes = True
        options.report_common_attributes = True

        input = "Wellington.osm"
        output ="WellingtonResaved.osm"

        with VectorLayer.create(output, Drivers.osm_xml) as new_layer:
            with VectorLayer.open(input, Drivers.osm_xml) as layer:
                for attr in layer.attributes:
                    new_layer.attributes.add(attr)

                for feature in layer:
                    new_layer.add(feature)

        with codecs.open(output, 'r', "utf_8_sig") as file:
            data = file.read()
            dot_count = data.split('.')
            comma_count = data.split(',')

            # Count of commas and dots are calculated by eyes
            assert len(dot_count) >= 29059 and len(comma_count) <= 13