-1

I was trying to extract data from an ESRI map embedded in a website. The objective would be by introducing geographic coordinates to be able to access the values ​​present on the map.

I leave here a print of the map and the respective address. I just cannot understand which method I should use since the map is embedded in the site. What processes should I use?

*for academic purposes

enter image description here

João Santos
  • 194
  • 11

2 Answers2

1

I must admit, I am not quite sure what you are after in terms of extracting data. I visited the site, and it is a pretty basic embedded web map created using the ArcGIS API for JavaScript, albeit wrapped in JSP. The web map is consuming some publicly accessible Esri services (World_Imagery, World_Boundaries_and_Places), and some non-public organizational services from www.portaldasfinancas.gov.pt.

It seems to me you are interested in geocoding. The pointer/marker on your map was looked up using Esri's ArcGIS Online Geocoding Service:

You have reached the home for the ArcGIS Online Geocoding Service. Use it to turn addresses into coordinates, coordinates into addresses, or to locate a point-of-interest.

If you are a developer, detailed documentation for using this service in your application is available in the ArcGIS Online Geocoding Service Help.

If you are an ArcGIS for Desktop user, you can use this service for finding addresses interactively or geocoding a table of addresses.

Since I am not quite clear what you are trying to do, this is about all I can offer for now.

bixb0012
  • 161
  • 1
  • 8
1

Note: Please respect data ownership. When in doubt, don't save a copy of someone else's data.

It sounds like you want to extract the polygon data in this map. The web app is making requests like this:

https://zonamentopf.portaldasfinancas.gov.pt/simulador/proxy.jsp?http://ags/arcgis/rest/services/SIMIMI/SIMIMI/MapServer/identify?f=json&tolerance=0&returnGeometry=false&imageDisplay=400%2C400%2C96&geometry=%7B%22x%22%3A-886651.3363331377%2C%22y%22%3A4443259.272690449%7D&geometryType=esriGeometryPoint&sr=102100&mapExtent=-887053.8250602124%2C4442583.282721534%2C-885178.7292100423%2C4443968.70385924&layers=all%3A0%2C1%2C2%2C3%2C4&callback=dojo.io.script.jsonp_dojoIoScript11._jsonpCallback

You can remove the callback parameter if you just want the data:

https://zonamentopf.portaldasfinancas.gov.pt/simulador/proxy.jsp?http://ags/arcgis/rest/services/SIMIMI/SIMIMI/MapServer/identify?f=json&tolerance=0&returnGeometry=false&imageDisplay=400%2C400%2C96&geometry=%7B%22x%22%3A-886651.3363331377%2C%22y%22%3A4443259.272690449%7D&geometryType=esriGeometryPoint&sr=102100&mapExtent=-887053.8250602124%2C4442583.282721534%2C-885178.7292100423%2C4443968.70385924&layers=all%3A0%2C1%2C2%2C3%2C4

However, if you just go to that link, you will get an error about a missing or incorrect referrer. To overcome that, you will need to add a header called Referer with value https://zonamentopf.portaldasfinancas.gov.pt/simulador/default.jsp. You can do that in a script or in an application like Postman, but you will not be able to do it in your own web app.

To view the available layers: https://zonamentopf.portaldasfinancas.gov.pt/simulador/proxy.jsp?http://ags/arcgis/rest/services/SIMIMI/SIMIMI/MapServer?f=json (with the Referer header I mentioned)

To view metadata about a single layer, use the following URL. Replace the 0 in /0/ with a different layer ID to get a different layer. https://zonamentopf.portaldasfinancas.gov.pt/simulador/proxy.jsp?http://ags/arcgis/rest/services/SIMIMI/SIMIMI/MapServer/0?f=json (with the Referer header I mentioned)

To query one of those layers to get the data, use the following URL to get everything, or add some query parameters if you want to filter the data. Replace the 0 in /0/ with a different layer ID to get a different layer. https://zonamentopf.portaldasfinancas.gov.pt/simulador/proxy.jsp?http://ags/arcgis/rest/services/SIMIMI/SIMIMI/MapServer/0/query?f=json&outFields=*&where=0%3D0 (with the Referer header I mentioned)

Related answer: https://stackoverflow.com/a/50213419/720773

Gary Sheppard
  • 4,764
  • 3
  • 25
  • 35