Finding if an address resides within a city boundary

199
3
04-28-2021 01:41 PM
tomar2
by
New Contributor

Hi, all. I would imagine this isn't an uncommon scenario but I'm not finding it on the site, so I'll ask it and then follow-up with my eventual solution to hopefully help other newcomers like myself.

We are currently using OpenStreet to look-up city boundary information and then determine if an address falls within city limits. However, our client uses the ArcGIS REST services and the boundaries don't always correspond between the two systems. So, we are moving over to the ArcGIS system at gissd.sandag.org.

My goal is to get an address, look to see if it's in the city limits, and then direct the user accordingly. I was guided to use: https://gissd.sandag.org/rdw/rest/services/Jurisdiction/PLT_Jurisdictions_search/MapServer/0

So, here are a handful of questions as someone entirely new to this system:

  • Do I need a token to use this service for our look-ups?
  • Returned geometry as a polygon works great but I don't know what those units are... it doesn't look like standard lat/lon and I don't know how to convert the results to lat/lon?
  • Is there already a web API for seeing if a point (i.e. address) falls within an area? I don't want to rewrite something that's already there (and probably better)

Thank you very much and sorry for what I'm guessing is effectively a basic question(s).

Tom

0 Kudos
3 Replies
DavidPike
MVP Frequent Contributor

looks like your california areas are in NAD 1983 StatePlane California VI FIPS 0406 Feet: ESRI Projection -- Spatial Reference

It says so on the page URL 🙂Jurisdiction/PLT_Jurisdictions_search (MapServer) (sandag.org)

You can just submit a query to Query: Search City (ID: 0) (sandag.org)

Will take a bit of playing about with if you're not used to it (I'm not either!)

0 Kudos
tomar2
by
New Contributor

Re: the units it's in...🤦 ..ugh.. I blame sensory overload as I was trying to take this all in. 😉 Thank you for pointing that out.

OK, so no token, I need to find the address look-up so I get the same units as the boundaries, and then find a good algorithm for determining if a point is within those boundaries. I'll share what I come up with just in case someone else -- even someone who reads better than I do -- wants to improve upon whatever I come up with.

Thanks, @DavidPike .

0 Kudos
DavidPike
MVP Frequent Contributor

The service query can perform the geometry intersection, just input the geometry to the query (intersects). 

I believe you just specify the input spatial reference and any transformation is done by the geometry engine, but I'm maybe straying away from explicit experience.

The developer window in your browser is also incredibly helpful to see how the actual query URL is encoded.

query features in a webmap/app with the developer window open and you'll start to get an understanding of what's going on behind the hood.

0 Kudos