Mapping to Protect Los Alamos Open Space (30 Day Map Challenge Day 3, Polygons)
How to Add Data from ArcGIS Web Maps to QGIS
Open Space advocates in Los Alamos county have been fighting the forces of development.
Ordinarily that's not a big problem. This county is wildly supportive of its open space; a huge percent of residents hike, bike, watch birds or otherwise appreciate the natural beauty around us. It helps that a lot of the town is on finger mesas adjacent to un-developable canyons, so you never need to go very far to be in a natural space.
But the county also loves to hire out-of-state consultants any time anything is changing, and a couple of years ago, they hired a consulting firm to rewrite Chapter 16 of our county code, concerning development. That included the zoning maps. The consultants capriciously changed several parcels previously zoned as open space to zones that allow much more development (like six-story apartment or commercial buildings), ignoring public input protesting the changes, and the County Council rubber-stamped the consultants' changes, promising to revisit the open space changes soon.
That was a year ago, and we've been lobbying the Council since then to address the problem, hearing lots of promises but no action.
One thing that helped was making a map of the parcels involved. We're lucky to have a very good GIS person, Michael Smith, working for the county, who provided the current list of parcels including zoning information. He also cleared up some questions we had about land ownership, based on wrong information I'd found in the BLM GIS file on UNM RGIS
I loaded the shapefile he sent me into QGIS, set its Symbology to Categorized and spent a while adjusting the colors for the various openspace parcels (I've written about that separately: Categorized Styles in QGIS). Then I used Select Features by Area or Single Click mode (currently the leftmost button on QGIS's fourth toolbar) to select just the ones with problematic zoning, and by right-clicking on the layer and choosing Save Selected Features as... I made a separate layer for just those parcels.
Loading GIS Data from ArcGIS Web Maps
But Michael also gave me a wonderful tip: that QGIS could load the current GIS data used for the county's excellent online interactive Los Alamos County Parcel Viewer. Using the instructions at Adding ArcGIS Online Services to QGIS (basically, just use QGIS's Layer→Add Layer→Add ArcGIS Map Server Layer... ) with a URL he gave me for the Parcel Viewer REST service, I can keep up to date without having to pester him for updated data.
What an amazing feature!
Of course, I wanted to use it for other ArcGIS web maps I've seen. But how do you get the right URL? (Just pasting the URL from an interactive web map doesn't work, I tried.)
A little web searching found the answer: use the browser's development tool to monitor URLs used when loading the map, with emphasis on URLs that include /MapServer or /FeatureServer.
For instance, starting at the Parcel Viewer (if Michael hadn't already helpfully provided the REST URL): bring up your browser's web developer tools window (the easiest way is to right-click in the page and choose Inspect). Click on the Network tab. (I'm using Firefox, but Chrome and Chromium instructions are basically the same.) Then Reload the web map.
You'll see a huge, long list of URLs in the Network tab. Don't panic! There's a Filter URLs field at the top. You're looking for URLs that include MapServer or FeatureServer, so filter by Server. The list is still long, but it's not as long. Scroll to the top of the list and hover over each entry to see the full URL.
The first few will probably be general basemaps, like
https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer?f=json
:
clearly not what you want. Then there will be a bunch of (I think) tiles
loaded from that basemap.
But if you keep at it, a little way down you'll
find
https://gis.losalamosnm.us/securegis/rest/services/parcelviewer/ParcelViewerBaseLayers_AGOL/MapServer?f=json
.
Remove the query parameters — the ?f=... part at the end
— and now you have something you can paste into the QGIS
ArcGIS REST Server Connection dialog. Click OK in the
Connection dialog.
Then click Connect in the main dialog, and you should have a list of
usable layers. Click on one of the layers and you can Add
that layer to your QGIS map.
[ 15:36 Nov 03, 2024 More mapping | permalink to this entry | ]