27 lines
1.4 KiB
Markdown
27 lines
1.4 KiB
Markdown
|
|
# Map Rendering
|
|
|
|
The code performs the following actions:
|
|
|
|
1. It determines an available file name by appending a number to a base file name until a file with that name does not exist.
|
|
|
|
2. It creates a collection of different geometries, including a point, a line, and a polygon.
|
|
|
|
3. It defines colors for each geometry.
|
|
|
|
4. It creates an in-memory layer to map each geometry with its respective color. The layer has an attribute named "Color" of type Integer.
|
|
|
|
5. It loops through the geometries and creates a feature for each geometry. The feature is assigned the corresponding color value and geometry, and then added to the layer.
|
|
|
|
6. It creates a new map instance with a specified size and padding.
|
|
|
|
7. It sets up different symbolizers (pointSymbolizer, lineSymbolizer, and polygonSymbolizer) to configure the rendering appearance based on the "Color" attribute value of each feature.
|
|
|
|
8. It adds the layer to the map, along with the symbolizers, to define how each geometry should be represented.
|
|
|
|
9. It renders the map to a file with the available file name and specified file extension.
|
|
|
|
10. It returns the name of the rendered file.
|
|
|
|
In summary, the code creates a map with different geometries and their associated colors. It renders the map to an image file and returns the file name. The code essentially renders a collection of geometries with custom colors to an image using the Aspose.Gis library.
|