HOWTO - Create a non-hierarchical locality from a map in a reference.
Last Updated: 19th Jan 2020By Jolyon Ralph
Non-hierarchical localities are perfect for regions that don't exactly coincide with political boundaries. So, this works great for mining districts, intrusive massifs, pegmatite fields etc which can span a great area.
Often these have been added in incorrectly to the locality hierarchy (before we had the system to deal with them as we do now) and they need cleaning up. Let's take an example
Why is this so bad? Let's look at the sub-localities.
Maués is a political division (a municipality) which should be immediately below the state (Amazonas), but instead we have this mineral province in-between.
What happens when we have localities within Maués that are not part of this mineral province? Another Maués entry needs to be added outside the mineral province and the sub-localities are split.
None of this is good. Which is why we have a rule that you never put geographical/geological/mining regions at a higher level in the hierarchy than political divisions.
So, to solve this we need to move Tapajós mineral province to a non-hierarchical locality, and move all of the current sub-localities back to being sub-localities of Amazonas.
There are two tasks needed to do this. First we have to do the re-arranging, this is simple. Then we have to define the area of the Tapajós mineral province as a GeoJSON file. This is harder!
So, let's move the localities in one block without needing to move each of the sub-localities individually.
On the locality page under 'Admin' you should find an option 'Convert to Non-Hierarchical'. Use this option.
Now, we need to add a polygon boundary to catch all the other sub localities that weren't previously listed. This is the more complex part!
First, you need to find a map showing the boundaries of the region. It also must have a coordinate grid visible. Searching Google for the name of the province, and switching to image search often does the trick.
You are looking for a map that shows the clear boundaries of the region, it can be irregular it doesn't have to be a rectangle, but in this case it is.
We found this
It's from this article:
https://www.sciencedirect.com/science/article/pii/S089598111530095X
Don't worry if you don't have access to the full article, because in this case and in many cases the image within the Google Images preview is good enough.
Save the Google Images image to your computer.
Now, we need some clever software. If you have ArcGIS then you can do it with that, but most people can't afford this, so we're going to use the free QGIS software. It's complicated to set up but you only have to do this once.
https://qgis.org/en/site/
Download the software and install it. You may need to install Python first, make sure to check which version of Python the QGIS installer asks for, currently it asks for v3.6, so I have installed version 3.6.6 - version 3.7 doesn't work!
So assuming this all went well, you can load QGIS and you'll get a screen something like this:
Now you need to go to the Plugins/Manage and Install Plugins menu.
At the moment there seems to be a bug which means that you can't activate the correct extension without following this exact procedure.
On the left click 'INSTALLED'
In the search box type georef
Make sure the checkbox next to Georeferencer GDAL is checked, and close.
If you did this right you should see a new option for Georeferencer in the Raster Menu. We can start the procedure for converting your map. select the Georeferencer option and a new window should open.
Now, go to File/Open Raster, and select the map image you saved previously.
You may get a Coordinate Reference System Selector box pop up. Make sure the WGS 84 option (EPSG:4326) is selected.
Now your map should be loaded.
Now, we need to align the image with some geographical points. We will add four points of latitude/longitude within the map to allow the software to understand exactly where in the world this map represents.
Click on the point where the 50 W and 4 N lines intersect. You may prefer to zoom in to do this.
You'll be asked to enter the latitude and longitude of the point. We enter -50 for East, and 4 for North.
Now, do the same thing for at least three more points ideally one in each corner of the map.
Now, go to Settings/Transformation Settings and make sure the three top settings are as shown below, and you need to select an output raster (filename to save the file). Check the 'Load in QGIS when done' box.
Click OK and you're ready to convert. Now go to the File menu and choose 'Start Georeferencing'.
Your map should now be loaded into the main QGIS application.
Now we start tracing. Go to the Layer Menu, select Create Layer, and then New Temporary Scratch Layer
You want to make sure the options are selected as below:
Now, look at the toolbar, make sure the yellow pencil icon is activated (clicked in), and then click the 'Add Polygon Feature' icon (see below)
Now, click on a start point in the region we want to define, and click points around the region until you are close to the end, then click the right mouse button to join all together.
You should see the region covered with a solid block of colour, as below. Remember, this example is a simple rectangle, but it can be irregular shapes, and can even be multiple areas with different polygons, or polygons with holes in them (although that's a bit more complex and I'd suggest reading up more about QGIS for doing that.)
Now, click the right mouse button on 'New scratch layer' in the Layers panel, and select Export/Save Features As...
Make sure format is set to GeoJSON and select a destination filename. Again, make sure WGS84 is selected.
Export this and you're finished with QGIS.
Now, go back to mindat and find the locality page. Edit the locality, go down to the 'Geospatial Information' area, and check the 'This is a non-hierarchical locality' box.
Click 'Upload a file' and select the file you just saved from QGIS. You should then see the data load like this:
Now, save the locality edits and you're finished.... almost!
Return to the locality page and hey - we have a working non-hierarchical locality.
Almost perfect, except let's just check the Localities in this Region section.
Can you see the problem? This province extends beyond the Amazonas state into Pará state, and we have another Tapajós mineral province page for the Pará state.
So, we need to edit this page again and take Amazonas out of the hierarchy, this province can only sit at the higher level immediately under Brazil.
Save the change. Now search mindat for Tapajós, find the OTHER mineral province page, and edit that to move the sub-localities out to the parent region in exactly the same way you did before. But this time, when you do the step where you DON'T FORGET to uncheck the 'Fix all child localities' box, you can remove the region name as well. Also make sure at this point that the page is also set as a non-hierarchical locality. You don't need to upload the GeoJSON file again.
Now you have two pages with exactly the same title, which will at some point be merged together by our admin team, but for now you don't need to worry about that. Just view the page and you should now see everything is right!
Now, after cleaning everything up, we have the mineral province correct and the localities all in their correct political regions. Well done!
ps. If you're feeling brave and you still have QGIS loaded, note that there are OTHER mineral provinces on the map, you can go back and use the map you've already georeferenced and draw more polygons over those regions, and save those out as individual GeoJSON files too. Either update existing mindat localities as we did above or create new ones if they aren't already in the system.
Often these have been added in incorrectly to the locality hierarchy (before we had the system to deal with them as we do now) and they need cleaning up. Let's take an example
Why is this so bad? Let's look at the sub-localities.
Maués is a political division (a municipality) which should be immediately below the state (Amazonas), but instead we have this mineral province in-between.
What happens when we have localities within Maués that are not part of this mineral province? Another Maués entry needs to be added outside the mineral province and the sub-localities are split.
None of this is good. Which is why we have a rule that you never put geographical/geological/mining regions at a higher level in the hierarchy than political divisions.
So, to solve this we need to move Tapajós mineral province to a non-hierarchical locality, and move all of the current sub-localities back to being sub-localities of Amazonas.
There are two tasks needed to do this. First we have to do the re-arranging, this is simple. Then we have to define the area of the Tapajós mineral province as a GeoJSON file. This is harder!
So, let's move the localities in one block without needing to move each of the sub-localities individually.
On the locality page under 'Admin' you should find an option 'Convert to Non-Hierarchical'. Use this option.
Now, we need to add a polygon boundary to catch all the other sub localities that weren't previously listed. This is the more complex part!
First, you need to find a map showing the boundaries of the region. It also must have a coordinate grid visible. Searching Google for the name of the province, and switching to image search often does the trick.
You are looking for a map that shows the clear boundaries of the region, it can be irregular it doesn't have to be a rectangle, but in this case it is.
We found this
It's from this article:
https://www.sciencedirect.com/science/article/pii/S089598111530095X
Don't worry if you don't have access to the full article, because in this case and in many cases the image within the Google Images preview is good enough.
Save the Google Images image to your computer.
Now, we need some clever software. If you have ArcGIS then you can do it with that, but most people can't afford this, so we're going to use the free QGIS software. It's complicated to set up but you only have to do this once.
https://qgis.org/en/site/
Download the software and install it. You may need to install Python first, make sure to check which version of Python the QGIS installer asks for, currently it asks for v3.6, so I have installed version 3.6.6 - version 3.7 doesn't work!
So assuming this all went well, you can load QGIS and you'll get a screen something like this:
Now you need to go to the Plugins/Manage and Install Plugins menu.
At the moment there seems to be a bug which means that you can't activate the correct extension without following this exact procedure.
On the left click 'INSTALLED'
In the search box type georef
Make sure the checkbox next to Georeferencer GDAL is checked, and close.
If you did this right you should see a new option for Georeferencer in the Raster Menu. We can start the procedure for converting your map. select the Georeferencer option and a new window should open.
Now, go to File/Open Raster, and select the map image you saved previously.
You may get a Coordinate Reference System Selector box pop up. Make sure the WGS 84 option (EPSG:4326) is selected.
Now your map should be loaded.
Now, we need to align the image with some geographical points. We will add four points of latitude/longitude within the map to allow the software to understand exactly where in the world this map represents.
Click on the point where the 50 W and 4 N lines intersect. You may prefer to zoom in to do this.
You'll be asked to enter the latitude and longitude of the point. We enter -50 for East, and 4 for North.
Now, do the same thing for at least three more points ideally one in each corner of the map.
Now, go to Settings/Transformation Settings and make sure the three top settings are as shown below, and you need to select an output raster (filename to save the file). Check the 'Load in QGIS when done' box.
Click OK and you're ready to convert. Now go to the File menu and choose 'Start Georeferencing'.
Your map should now be loaded into the main QGIS application.
Now we start tracing. Go to the Layer Menu, select Create Layer, and then New Temporary Scratch Layer
You want to make sure the options are selected as below:
Now, look at the toolbar, make sure the yellow pencil icon is activated (clicked in), and then click the 'Add Polygon Feature' icon (see below)
Now, click on a start point in the region we want to define, and click points around the region until you are close to the end, then click the right mouse button to join all together.
You should see the region covered with a solid block of colour, as below. Remember, this example is a simple rectangle, but it can be irregular shapes, and can even be multiple areas with different polygons, or polygons with holes in them (although that's a bit more complex and I'd suggest reading up more about QGIS for doing that.)
Now, click the right mouse button on 'New scratch layer' in the Layers panel, and select Export/Save Features As...
Make sure format is set to GeoJSON and select a destination filename. Again, make sure WGS84 is selected.
Export this and you're finished with QGIS.
Now, go back to mindat and find the locality page. Edit the locality, go down to the 'Geospatial Information' area, and check the 'This is a non-hierarchical locality' box.
Click 'Upload a file' and select the file you just saved from QGIS. You should then see the data load like this:
Now, save the locality edits and you're finished.... almost!
Return to the locality page and hey - we have a working non-hierarchical locality.
Almost perfect, except let's just check the Localities in this Region section.
Can you see the problem? This province extends beyond the Amazonas state into Pará state, and we have another Tapajós mineral province page for the Pará state.
So, we need to edit this page again and take Amazonas out of the hierarchy, this province can only sit at the higher level immediately under Brazil.
Save the change. Now search mindat for Tapajós, find the OTHER mineral province page, and edit that to move the sub-localities out to the parent region in exactly the same way you did before. But this time, when you do the step where you DON'T FORGET to uncheck the 'Fix all child localities' box, you can remove the region name as well. Also make sure at this point that the page is also set as a non-hierarchical locality. You don't need to upload the GeoJSON file again.
Now you have two pages with exactly the same title, which will at some point be merged together by our admin team, but for now you don't need to worry about that. Just view the page and you should now see everything is right!
Now, after cleaning everything up, we have the mineral province correct and the localities all in their correct political regions. Well done!
ps. If you're feeling brave and you still have QGIS loaded, note that there are OTHER mineral provinces on the map, you can go back and use the map you've already georeferenced and draw more polygons over those regions, and save those out as individual GeoJSON files too. Either update existing mindat localities as we did above or create new ones if they aren't already in the system.
Article has been viewed at least 1881 times.