Skip to content

Instantly share code, notes, and snippets.

@pramsey
Created June 18, 2018 17:55
Show Gist options
  • Select an option

  • Save pramsey/0da5fac6f1c0879ef8499416c5b4c92f to your computer and use it in GitHub Desktop.

Select an option

Save pramsey/0da5fac6f1c0879ef8499416c5b4c92f to your computer and use it in GitHub Desktop.
VRT file to write both 'the_geom' and 'the_geom_webmercator' columns
<?xml version="1.0"?>
<OGRVRTDataSource>
<OGRVRTWarpedLayer>
<OGRVRTLayer name="cartogeom">
<SrcDataSource>cartogeom.csv</SrcDataSource>
<GeometryField name="the_geom" encoding="PointFromColumns" x="longitude" y="latitude">
<GeometryType>wkbPoint</GeometryType>
<SRS>EPSG:4326</SRS>
</GeometryField>
<GeometryField name="the_geom_webmercator" encoding="PointFromColumns" x="longitude" y="latitude">
<GeometryType>wkbPoint</GeometryType>
<SRS>EPSG:4326</SRS>
</GeometryField>
<Field name="name" />
<Field name="desc" />
</OGRVRTLayer>
<WarpedGeomFieldName>the_geom_webmercator</WarpedGeomFieldName>
<TargetSRS>EPSG:3857</TargetSRS>
</OGRVRTWarpedLayer>
</OGRVRTDataSource>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment