Create a design file and attach a geographic coordinate system. This ensures that the imported graphics will be drawn in the correct space.
In this example the Excel file contains location and property information for wells:
ID, BOOK, OPERATOR, STATUS, X_SURF, L_SURF, ELEVATION, TD, FIELD, LEASENAME, LEASENUM and COMPDATE.
Save the Excel file to the CSV format. In this example, the file is named Wells.csv.
For the import, a metafile is created (a file with the extension VRT and the Open Source GDAL format, see https://gdal.org/ and https://gdal.org/en/stable/drivers/vector/vrt.html).
Create a new text file named "Well Import.vrt" and copy/paste the following lines of text:
<OGRVRTDataSource> <OGRVRTLayer name="well"> <SrcDataSource>well.csv</SrcDataSource> <SrcLayer>Well</SrcLayer> <GeometryType>wkbPoint</GeometryType> <LayerSRS>wgs84</LayerSRS> <GeometryField encoding="PointFromColumns" x="x_surf" y="y_surf"/> </OGRVRTLayer> </OGRVRTDataSource>
The graphics are imported into the open design file and are automatically converted to OpenCities Map features with properties.
Additional Information 1:
The following VRT template can be used to create a custom VRT file to import an XLSX file with points. The coordinates are listed in the columns Lat and Long. During import the coordinates are transformed to the coordinate system of the active model. The attached ZIP file addresses.zip contains an example.
Note: A VRT file can be created quickly using AI-tools, by dragging the XLS in the AI-dialog.
<OGRVRTDataSource>
<OGRVRTLayer name="Blad1">
<SrcDataSource>Address.xlsx</SrcDataSource>
<SrcLayer>Blad1</SrcLayer>
<GeometryType>wkbPoint</GeometryType>
<LayerSRS>EPSG:4326</LayerSRS>
<GeometryField encoding="PointFromColumns" x="Long" y="Lat"/>
<Field name="Worker" type="String"/>
<Field name="Postcode" type="String"/>
<Field name="Address_complete" type="String"/>
<Field name="City" type="String"/>
<Field name="Contract_code" type="String"/>
<Field name="Usage_Code" type="String"/>
<Field name="Day" type="String"/>
<Field name="Contract_Rule" type="String"/>
<Field name="Address" type="String"/>
<Field name="Contract_even_week" type="String"/>
<Field name="Day_Number" type="Integer"/>
<Field name="Fullfill_criteria" type="Integer"/>
<Field name="Contract_invoice" type="String"/>
</OGRVRTLayer>
</OGRVRTDataSource>
Additional Information 2:
The following VRT templates can be used to create a custom VRT files based on linestrings, polygons and points.
Edit the layer name, data source, and x/y columns as needed.
Linestrings:
<OGRVRTDataSource> <OGRVRTLayer name="Linestrings"> <SrcDataSource relativeToVRT="1">linestrings.csv</SrcDataSource> <GeometryType> wkbLineString</GeometryType> <LayerSRS> WGS84</LayerSRS> <GeometryField encoding="WKT" field="WKT"/> </OGRVRTLayer> </OGRVRTDataSource>
Polygons:
<OGRVRTDataSource> <OGRVRTLayer name="Polygons"> <SrcDataSource relativeToVRT="1">polygons.csv</SrcDataSource> <GeometryType> wkbPolygon</GeometryType> <LayerSRS> WGS84</LayerSRS> <GeometryField encoding="WKT" field="WKT"/> </OGRVRTLayer> </OGRVRTDataSource>
Points:
<OGRVRTDataSource> <OGRVRTLayer name="Points"> <SrcDataSource relativeToVRT="1">points.csv</SrcDataSource> <GeometryType> wkbPoint</GeometryType> <LayerSRS> WGS84</LayerSRS> <GeometryField encoding="PointFromColumns" x="X" y="Y"/> </OGRVRTLayer> </OGRVRTDataSource>
Note: The element <LayerSRS> is not required. With this information the features are transformed to the local geographic coordinate system during import.
A sample dataset for practice is attached for your reference (see the Attachments section above on this page).