Welcome to the geofictician wiki.

User:Luciano/Sandbox/Maperitive/OverviewMap and Makaska Neighborhoods: Difference between pages

From Geofictician
< User:Luciano‎ | Sandbox‎ | Maperitive(Difference between pages)
Jump to navigationJump to search
imported>Luciano
(Created page with "This is an "overview map" that is made using some extracts and transformations on the OGF world backup file (.pbf), followed by a Maperitive ruleset. File:Maperitive_Overv...")
 
imported>Luciano
No edit summary
 
Line 1: Line 1:
This is an "overview map" that is made using some extracts and transformations on the OGF world backup file (.pbf), followed by a Maperitive ruleset.
== All Makaska Neighborhoods (nodes) ==


[[File:Maperitive_OverviewMap_Test1.jpg|1200px]]
::''The following data has been retrieved from [https://osm3s.opengeofiction.net/api/interpreter?data=node%5B%22place%22=%22neighbourhood%22%%5D%5B%22is_in:state%22=%22Makaska%22%5D;out; this URL], using the [http://www.mediawiki.org/wiki/Extension:External_Data External Data] MediaWiki extension.''


Note that in the above map, some countries aren't showing up, and there are lots of mistakes. That's because it's based on the actual current data in OGF put there by mappers. Countries with broken border relations don't show up at all. Other countries have out of date or incorrect information of various kinds in their labels.  
{{#clear_external_data:}}
{{#get_web_data:url=https://osm3s.opengeofiction.net/api/interpreter?data=node%5B%22place%22=%22neighbourhood%22%5D%5B%22is_in:state%22=%22Makaska%22%5D;out;
|format=xml
|data=
node_id=/osm/node/@id
,name=/osm/node/tag[@k='name']/@v
,county=/osm/node/tag[@k='is_in:county']/@v
,township=/osm/node/tag[@k='is_in:township']/@v
,city=/osm/node/tag[@k='is_in:city']/@v
|use xpath}}
{| class="wikitable sortable"
! Name
! City
! Township
! Parish
! Map
{{#for_external_table:<nowiki/>
{{!}}-
{{!}}{{{name}}}
{{!}}[[{{{city}}}]]
{{!}}[[{{{township}}}]]
{{!}}[[{{{county}}}]]
{{!}}[http://opengeofiction.net/node/{{{node_id}}} (node {{{node_id}}})]
}}
|}


In order for this to be successful, we would need to "clean up" our map data a lot
Just a test.....
 
The '''advantage''' would be that we could eliminate the need to maintain a separate overview map. We could create a script to re-generate this map on a regular basis.
 
In my offline OSM file, I added a tag called "ogf:status" that could be used to drive the coloring on the map. So the colors are based on my additions to the .OSM file.
 
One challenge was to get country labels that appear in a useful way. I did some data transformations using osmconvert and osmfilter first. To make typing the commands easier (I still haven't made a script), I named my files "o.osm", "ov.osm" etc. The effect of these transformations is to
 
* simplify the data set, eliminating as much irrelevant data as possible from the world file - no streets, no features... only coastlines and country boundaries
<pre>
>osmconvert o.pbf -o=o.o5m
 
>osmfilter o.o5m --keep="natural=coastline or admin_level<3 " -o=ov.osm
</pre>
* create a label node for the center of each admin_level=2 boundary relation and merge it into the osm file
<pre>
>osmconvert ov.osm --all-to-nodes -o=on.osm
 
>osmfilter on.osm --keep="@id>2000000000000000 and type=boundary and admin_level<3" -o=ob.osm
 
>osmconvert ov.osm ob.osm -o=om.osm
</pre>
 
Then we can open the output file, ''om.osm'', using Maperitive, with the following ruleset:
<pre>
// origin: http://opengeofiction.net/wiki/index.php/User:Luciano/Sandbox/Maperitive/OverviewMap
 
features
lines
all lines :
areas
active : relation[ ( NOT "ogf:owner"="[all]" AND NOT "ogf:owner"="[free]" AND NOT "ogf:status" ) OR "ogf:status"="active"]
all : relation[ ( "ogf:owner"="[all]" AND NOT "ogf:owner"="[free]" AND NOT "ogf:status" ) OR "ogf:status"="all"]
collab : relation["ogf:status"="collaborative"]
free : relation[ ( "ogf:owner"="[free]" AND NOT "ogf:owner"="[all]" AND NOT "ogf:status" ) OR "ogf:status"="free"]
inactive : relation["ogf:status"="inactive"]
points
label : [ogf:id AND type=boundary]
properties
map-background-color : #e1e1e1
 
rules
 
target : label
define
font-family : Ariel
text-align-horizontal : center
text-align-vertical : center
text : [[ogf:id]] "\n" name "\n" [[ogf:owner]]
font-size : 10
font-weight : bold
fill-color : #fcfcfb
text-color : #060606
text-halo-width : 0
shape : square
shield-resize-mode : free
draw : shield
 
target : free
define
fill-color : #009000
fill-opacity : 0.7
draw : fill
 
target : inactive
define
fill-color : #FFFF00
fill-opacity : 0.7
draw : fill
 
target : collab
define
fill-color : #800080
fill-opacity : 0.7
draw : fill
 
target : all
define
fill-color : #0000FF
fill-opacity : 0.7
draw : fill
 
target : active
define
fill-color : #0E1E0E
fill-opacity : 0.2
draw : fill
 
target : all lines
define
line-color : #fbe56b
line-width : 2
draw : line
</pre>

Revision as of 13:42, 5 August 2019

All Makaska Neighborhoods (nodes)

The following data has been retrieved from this URL, using the External Data MediaWiki extension.


Error while fetching data from URL https://osm3s.opengeofiction.net/api/interpreter?data=node%5B%22place%22=%22neighbourhood%22%5D%5B%22is_in:state%22=%22Makaska%22%5D;out;: $2.
Error fetching URL: Could not resolve host: osm3s.opengeofiction.net
There was a problem during the HTTP request: 0 Error
Could not get URL https://osm3s.opengeofiction.net/api/interpreter?data=node%5B%22place%22=%22neighbourhood%22%5D%5B%22is_in:state%22=%22Makaska%22%5D;out; after 3 tries.

Name City Township Parish Map

Just a test.....