locked
Spatial Overlay RRS feed

  • Question

  • Greetings,

     

    I am attempting to compare to polygon layers (parcel and zoning) to find the Zoning that intesects a specific Parcel polygon.  Can you direct me to any examples or documentation to figure out the syntax? 

     

    Thanks.

     

    JMK

    Wednesday, July 23, 2008 3:00 PM

Answers

  • Hi Isaac,

     

    I found the problem.  It was with the SRID not being the same for both layers.  I used FME Universal Translator to import the layers and it appears that it brought them in with different SRIDs.  I checked the FME Universal Translator interface and cannot seem to find a spot to specify the SRID.

     

    Once I changed the SRID; everything seemed to work.  Thanks for all your help.

     

    John

     

    Thursday, July 24, 2008 6:10 PM

All replies

  • Hello,

    Do you want to know how to display them and visually compare them, or how to do this through SQL?
    In the former case,
    you'd like pointers to visualization tools.  In the latter, SQL examples.

    Cheers,
    -Isaac
    Wednesday, July 23, 2008 4:06 PM
  • Thanks Isaac,

     

    Just through SQL - I have no issues viewing the layers.  I just want to be able to pass in a PID and return the corresponding Zone for that PID without touching a map.

     

    Thanks again,

     

    John

    Wednesday, July 23, 2008 7:39 PM
  • Hi John,

    This sounds like a pretty vanilla intersects query.  I don't know your schema, but if you have the tables Parcels(id, geog) and Zones(id, geog) you could issue:

    SELECT Zones.id
    FROM Zones JOIN Parcels ON Zones.geog.STIntersects(Parcels.geog) = 1
    WHERE Parcels.id = [whatever your id of interest is]

    Have you looked through the spatial information in BOL?

    Cheers,
    -Isaac
    Wednesday, July 23, 2008 8:28 PM
  • Thanks Isaac,

     

    I did attempt to run something similar however I do not get any results.  It is not failing just indicating that the 2 do not intersect.  FYI, my tables are Geometry Data Types, not Geography.  Could it have something to do with the spatial indexing?  Both are spatially indexed but I to remember when I worked with Oracle spatial there were issues around receiving acceptable results if you did not spatially index properly.

     

    Also, I am not familiar with BOL.

     

    Thanks again,

     

    John

     

     

    Thursday, July 24, 2008 3:10 PM
  • Hi John,

    Unfortunately, I can't offer any specific advice without specific examples: can you post a concrete example of what you'd like to do?

    BOL is Books Online.  You should be able to install this locally through the SQL Server installer, or you can view it online here.  For spatial, this is probably the right place to start.

    Cheers,
    -Isaac
    Thursday, July 24, 2008 3:33 PM
  • Hi Isaac,

     

    I found the problem.  It was with the SRID not being the same for both layers.  I used FME Universal Translator to import the layers and it appears that it brought them in with different SRIDs.  I checked the FME Universal Translator interface and cannot seem to find a spot to specify the SRID.

     

    Once I changed the SRID; everything seemed to work.  Thanks for all your help.

     

    John

     

    Thursday, July 24, 2008 6:10 PM