Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARC tile servers #484

Open
bnordgren opened this issue Mar 25, 2023 · 12 comments
Open

ARC tile servers #484

bnordgren opened this issue Mar 25, 2023 · 12 comments

Comments

@bnordgren
Copy link

Investigation of #483 strongly indicated that we were hitting MapBox's limit of 200,000 tiles/month for the free level of service that they offer. Investigations into whether the USFS geospatial services unit (GTAC) could host a tile server led to the suggestion that we just leverage ESRI's tile server by creating an API token from our enterprise accounts.

What ESRI Offers

The vast majority of ESRI's hosted tile layers are vector based, returning a *.pbf file. This is not natively understood by Leaflet. To use Leaflet as is, we need a pre-rendered raster tile. The listed raster products are:

  • ArcGIS:Imagery
  • ArcGIS:Imagery:Standard
  • ArcGIS:Imagery:Labels
  • ArcGIS:Oceans
  • ArcGIS:Hillshade:Light
  • ArcGIS:Hillshade:Dark

The non-imagery (satellite/airborne imagery) raster products have very little detail useful for dragging the selection rectangle over.

Apparent Options

  1. Use a client other than Leaflet;
  2. Get the vector plugin for Leaflet;
  3. Stick with MapBox; or
  4. Find another tile server.

Annex A: Create an AGOL account (USFS Employees)

Go to https://usfs.maps.arcgis.com/home/signin.html and log in with your eAuth account.

Annex B: Determining ESRI Hosted Layer Type

To determine whether a hosted layer is vector or raster, after you made yourself an API token, go to the hosted tile layers link above and:

  • right click on a layer of interest, and select "Copy link address"
  • open a new tab
  • paste the link into the address bar
  • substitute your actual token for the placeholder in the pasted URL
  • press return
  • if you get a page of json rather than ~8 lines, this is likely a vector, but Ctrl-F and search for "vector" to make sure
  • if you get a few lines, it's likely a raster layer, but look for a url that starts: "https://ibasemap-api..." (ibasemap not basemap) This is your template URL you can use in leaflet.
@bnordgren
Copy link
Author

Chatter around vector plugins suggests they're experimental and unsupported...

https://openmaptiles.org/docs/website/leaflet/

@nwagenbrenner
Copy link
Member

This link suggests that Esri vector tiles should work with leaflet.

https://developers.arcgis.com/esri-leaflet/layers/add-a-vector-tile-layer/

@bnordgren
Copy link
Author

Maybe this is the plugin we should be looking at:

https://github.com/Esri/esri-leaflet-vector

@bnordgren
Copy link
Author

... which has these dependencies...

Dependencies

Do you know what version of leaflet is bundled with windninja?

@nwagenbrenner
Copy link
Member

Looks like leaflet 1.3.4. We could probably update though?

https://github.com/firelab/windninja/tree/master/data/leaflet

@bnordgren
Copy link
Author

Prolly should anyway. So just spitballing, it sounds like the path of least resistance is option 2. We update the bundled leaflet, bundle esri-leaflet-vector and its dependencies, and tweak the downloader code.

I'm not going to get to this prior to AL in early April, as I need to focus on getting the Openstack hardware physically cabled. As long as the stopgap solution in #483 works for you for now, I can come back to this when I get back...

@nwagenbrenner
Copy link
Member

Sounds good to me. I released 3.8.1 with the solution in #483 yesterday, so we are good for a little bit. We can work on this when you're back. I'll probably try to release 3.9.0 with some other fixes/upgrades around the end of May/early June. Would be good to include this in that release.

@fspataro
Copy link

Slightly more advance option but might make it more seamless with the overall code base is to use the ArcGIS Qt SDK: https://developers.arcgis.com/qt/

This would give you a native form element rather than an embedded html/js page. If the functionality is simply 'display public maps from arcgis services and draw boundary polygons', you should be fine with the low level 'lite' (ie free) licensing level.

@nwagenbrenner
Copy link
Member

@fspataro Thanks Fred! We'll check this out.

@bnordgren
Copy link
Author

ArcGIS Maps SDK for Qt requires developers to adopt Qt 6, which allows the SDK to take advantage of new graphics APIs, platform architectures, language features, and more.

Perhaps using this SDK is a goal for when Windninja is pulled forward to a newer QT. OTOH, integrating this ESRI dependency may force future upgrades before you're ready. Unless you say otherwise, I'll start picking at option 2.

@bnordgren
Copy link
Author

Successfully converted html to esri-leaflet in my branch https://github.com/bnordgren/windninja/tree/arc_tile_servers

Works great in Firefox on ubuntu host. Doesn't want to work in the QT4 widget inside the app. What's the status of QT5 on master? I got an unresolved symbol when trying to run.

@nwagenbrenner
Copy link
Member

The Qt5 option in master is work that was done several years ago to attempt write a new GUI in Qt5. We didn't get very far and then decided for an even bigger overhaul to modernize the GUI with an in-app viewer in Qt5. Technosylva is helping us on this, but we haven't gotten very far. I haven't built with the Qt5 option in our master branch in a long time, some functions may have changed. I can't remember if it was using the C API or not. The easiest solution is to try and get something working in Qt4. I think our Qt5 GUI is still a ways out.

@nwagenbrenner nwagenbrenner modified the milestones: 3.9.0, 3.10.0 Jun 27, 2023
@nwagenbrenner nwagenbrenner modified the milestones: 3.10.0, Unplanned, 3.11.0 Jan 10, 2024
@nwagenbrenner nwagenbrenner modified the milestones: 3.11.0, 3.12.0 Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants