Skip to content

Instantly share code, notes, and snippets.

@chaosifier
Created April 29, 2022 07:27
Show Gist options
  • Select an option

  • Save chaosifier/441ecb9428fa36c0eae8b3154f830ff9 to your computer and use it in GitHub Desktop.

Select an option

Save chaosifier/441ecb9428fa36c0eae8b3154f830ff9 to your computer and use it in GitHub Desktop.
Importing and finding coordinates in a map from geospatial data.
- download qgis from https://qgis.org/en/site/
- C:\Program Files\QGIS 3.22.6\bin> ogr2ogr -progress -f "MSSQLSpatial" "MSSQL:server=DESKTOP-HE9GCV7;database=Sandbox;uid=sa;pwd=admin" "C:\Users\theUser\Downloads\NepalLocalUnits0_2022_April_29_10_05_55\NepalLocalUnits0\NepalLocalUnits0.shp" -a_srs "EPSG:4326" -lco PRECISION=NO
- in sql server
SELECT *
FROM nepallocalunits0
WHERE ogr_geometry.STContains(
geometry::STGeomFromText('POINT(87.9909718 26.6401384)', 4326)
) = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment