Skip to Main Content

Breadcrumb

Question and Answer

Thanks for the question.

Asked: December 08, 2023 - 8:43 pm UTC

Last updated: December 08, 2023 - 8:43 pm UTC

Version:

Viewed 1000+ times

You Asked

Greetings,
I have created a map in Oracle APEX where the user can click and get the lat and long and drop a pin there. Now, I want to find which congressional district the pin was dropped in. I have a table with all congressional districts, but that is geojson data that gives polygons for the congressional districts. Is there a way for me to search a congressional district using lat and long?
Your help will be greatly appreciated
TIA
Vatsa

and we said...

Yes, you can query for containment using a spatial operator as described here: https://docs.oracle.com/en/database/oracle/oracle-database/19/spatl/spatial-operators-reference.html You can try it with this LiveLabs self-paced workshop: https://apexapps.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=736 see Lab 4 Task 2 for containment queries.

Rating

  (1 rating)

We're not taking comments currently, so please try again later if you want to add a comment.

Comments

Thanks for your response.

Vatsa, December 11, 2023 - 3:07 pm UTC

I forgot to mention that the polygon data for the congressional districts in the table is ia CLOB and not SDO_GEOMETRY. Given a lat and long I want to find out which congressional district are those coordinates in.
Sorry for not being clear the first time.

Thanks
Vatsa