«Producir y nutrir,
producir y no poseer,
obrar y no retener,
acrecentar y no regir,
son el misterio de la vida.»
How to create border maps for your projects
When working with data projects it is usual to use administrative maps. In my experience is not trivial to find the cartographic files as open access or opensource data sources, so after some search I found a method to create an ad-hoc map for any administrative region coded into OpenStreetMap. It’s not a trivial method but it is no as complex as it seems at first sight. I’ll try to introduce the essential concepts to easy understand the recipe. If you know other methods as good or better than this please give me some feedback.
I used this method with geodata for Spain so I guess it works with any other administrative region coded in OSM.
First you need to know an OpenStreetMap concept: the relation. In our case we’ll use multipolygon relations, used to code the borders of areas of our interests. The important thing to remember here is you are going to use an OSM relation.
Second you’ll want to select the region of your interest and you’ll need to figure out how it has been mapped in OSM. So you need to find the related OSM relation. As example I’ll use Alamedilla, my parents’ town in the province of Granada, Spain.
the method
Go to https://www.openstreetmap.org and search for the region of your interest. For example Alamedilla:
Click to the correct place and you’ll see something like this:
Look at the URL box at the browser and you’ll see something like this: https://www.openstreetmap.org/relation/343442. The code number you need for the next steps is that one in the URL after the relation keyword. In this example is 343442.
Then visit the to overpass turbo service, a powerful web-based data query and filtering tool for OpenStreetMap:
The white box at left is where you write the code of your query for Overpass. You have a wizard tool in the menu but it’s not trivial too. Instead you could copy exactly this code:
[out:json][timeout:2500];
(
relation(343442)({{bbox}});
);
out body;
>;
out skel qt;
In your case you need to change the 349044 number (used for the Alamedilla’s example) with the relation number you got before. If you modify the query keep in mind the default timeout (25) maybe is not enough for your case.
Now, clicking the Run button you’ll execute your query. Keep in mind the resulting data set could be really big, depending how big the area is.
So, here it is:
Zoom the map to have a better view:
Now you’ll find the resulting data set in GeoJSON format ready at the Data tab (right side). If this format is fine for you you are done. But if you need some other you are lucky enough because when clicking into Export button you’ll find some other formats to export: GPX, KML and OSM data.
In this example we’ll use the KML format used by Google Earth, Maps and many others.
importing into Google Earth
Open Google Earth:
and open our kml file: [File][Open]:
and here it is:
Note: I modified the color (at the object properties) to make it more visible in the screenshot.
So, it is done. Now you can use the kml file in your application, import to any GIS software or convert to another format if required.
importing into Google Maps
Go to Google MyMaps and create a new one. Import a new layer an select your kml file:
Here it is:
conclusion
Now you are able to create maps of any region added into OpenStreetMap, export them to any of the said formats and import into your applications. Hope this helps.
If you finally use data from the OSM project remember to add the correct credits:
We require that you use the credit “© OpenStreetMap contributors”.
See credit details at osm.org/copyright.
This is an example of how AWESOME OpenStreetMap is and the extraordinaire work these people does. Big thanks to all of the contributros for these impressive service.
«Chris stared out of the window», a theological tale
My English class. You should write an story starting with 🙶Chris stared out of the window waiting for the phone to ring🙷. Let’s do it.
Chris stared out of the window waiting for the phone to ring. He looked into the void while his mind wandered. Time is passing, but it is not. For an eternal being all time is present, but not always is time present. The past, the future are just states of mind for an overlord. But he is still waiting for the phone to ring. Time is coming. The decision was made. It had always been made, before time existed indeed. Chris knows all the details of the plan. He knows because he is God too. He knows because he conceived it. No matter if he had been waiting for the starting signal. No matter if he expects the Holly Spirit to announce it to him. You can can call it protocol. He knows because he had decided how to do it. But Chris doubts. He is God. He is Holly Spirit. But he has been human too. The remembrance of his humanity brings him to a controversial state of mind. Now he doubts. He has been always doubting since the world is the world and before the existence of time. And after too, because he is an eternal being. He now relives the feelings of being a human. He relives all the feelings to be all the humans. He revisits joy and pain. Joy is good, sure. But joy is is nothing special for an overlord god. But pain… pain matters for a human — and Chris has been a human. Chris knows. Chris feels. Chris understands how sad human life can be. Chris knows because he is the Father creator. He created humans. He knows how mediocrity drives the character of all the creatures privileged with consciousness. A poisoned gift. He knows how evil is always just an expression of insecurities, the lack of certainty of what will happen tomorrow. What will happen just the next second. 🙶Will I be alive? Will be the pain still exists?🙷. He knows because he feels. And he doubts because he feels. He feels it can’t be fair to judge, to condemn, to punish a living being because it was created in that way. This would not be the full of love god the Evangelists announced. How could he punish for a sin he was the cause of. But, if not, can it be fair to all the others who behave according the Word. All of those, maybe with love, maybe will pain, maybe just for selfishness, fulfilled God’s proposal of virtue and goodness. How can not distinguish their works, to award their efforts. How can it be fair. How can he be good. His is the power and the glory. He is in doubt. The phone rings.
Some GNOME / LAS / Wikimedia love
For some time to know I’ve dedicating some more time to Wikimedia related activities. I love to share this time with other opensource communities I’m related to. This post is just to write down a list of items/resources I’ve created related with events in this domain.
Wikidata
If you don’t know about Wikidata probably you’ll look at it because it’ll be the most important linked data corpora in the world. In the future we will use WD as the cornerstone of many applications. Remember you read this here first.
About GUADEC:
About GNOME.Asia:
About LAS 2019:
And about the previous LAS format:
Wikimedia Commons
Wikimedia Commons is my current favorite place to publish pictures with open licensing these days. To me is the ideal place to publish reusable resources with explicit Creative Commons open licensing. And you can contribute with your own media without intermediaries.
About GUADEC:
About GNOME.Asia:
About LAS:
- Category:Libre Application Summit
- Category:Libre Application Summit 2018
- Category:Linux App Summit
- Category:Linux App Summit 2019
Epilogue
As you can check the list is not complete neither all items are fully described. I invite you to complete all the information you want. For Wikidata there are many places where ask help. And for WikiCommons you can help uploading your own pictures. If you have doubts just use current examples as references or ask me directly.