Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I imported a shapefile into MSSQL with geometry type.

ogr2ogr -f "MSSQLSpatial" "MSSQL:server=AAAAAA; database=BBBB; User Id=CCCC; Password=DDDDD;" "TEST.shp"

Insert into test2 select GEOGRAPHY::STGeomFromText(cast[ogr_geometry] as varchar (Max), 4326)

Intersect doesn't work and I get the following results

DECLARE @g geography;SET @g = geography::STGeomFromText('POLYGON((139.6340168 35.6073283,139.8998358 35.6073283,139.8998358 35.7219415,139.6340168 35.7219415,139.6340168 35.6073283))', 4326 );

SELECT  A.ogr_geography 

FROM [test2] A WITH (NOLOCK, INDEX=[spidx_test2]) WHERE A.ogr_geography.STIntersects( @g ) = 1 

enter image description here

question from:https://stackoverflow.com/questions/66057877/ogr2ogr-fail-with-st-intersects

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
666 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...