[OSM-talk] Mapnik config in JS

2018-11-08 Thread Martin Ždila
Hello,

Today's trend is to put many markups to JS (eg. CSS in JS, HTML in JS
(React), ...). Therefore I've decided to implement "Mapnik config in JS"
and I have a great pleasure using it to write my new outdoor map theme.

I only spend together maybe 2 or 3 full days to implement it all so the
style is still very incomplete and dirty.

You can see current result at
https://www.freemap.sk/?map=13/48.812516/21.114092&layers=X (make sure you
have not port 4000 blocked).

Map configuration (style and layers) are still in a single file [1] and
uses style builder [2] to create Mapnik XML.

I plan to extract the style builder to separate project to be easily usable
by other programmers.

Feel free to send me your feedback (mostly regarding style generator in JS
idea).

You can also check the whole project at
https://github.com/FreemapSlovakia/freemap-mapnik

Thanks.

[1]
https://github.com/FreemapSlovakia/freemap-mapnik/blob/master/lib/freemapStyleGenerator.js
[2]
https://github.com/FreemapSlovakia/freemap-mapnik/blob/master/lib/styleBuilder.js

Regards
-- 
Martin Ždila 
OZ Freemap Slovakia
tel:+421-908-363-848
mailto:martin.zd...@freemap.sk
http://www.freemap.sk/
___
talk mailing list
talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] osm2pgsql diff application with filtered OSM data

2018-11-08 Thread Paul Norman

On 2018-11-08 6:34 AM, Nick Whitelegg wrote:


At the moment I download full planet extracts about every 6 months. 
However, due to the limitations of my server, I filter out (with 
osmosis) a lot of stuff I don't need so that I am basically left with 
roads, footpaths, natural features, water features and selected POIs.



I'd like to move towards a system which applies diffs from geofabrik 
instead, and applies them regularly (daily or weekly) with osm2pgsql.



My question is this; given that not everything in the diff will be in 
my database (as I filter out what I don't need during the import 
process), will osm2pgsql apply the diff successfully or will it 
complain that not all features in the diff are in my database?




I can think of four ways to do this, all which have a different balance 
of correctness, performance, and ease of use.


There are two "right" ways to do this. The first one is to re-import 
every week. Because imports without slim tables (either --slim --drop or 
no --slim) are faster, this is a good option and needs less space than a 
database able to consume diffs.


The second right way involves keeping two files, one with the current 
full data, and one with the filtered data. Call these "planet.pbf" and 
"planet-filtered.pbf". Then when updating create "planet-new.pbf", 
filter it to get "planet-filtered-new.pbf", create a diff for the 
differences between "planet-filtered-new.pbf" and "planet-filtered.pbf", 
and apply that diff to the database. Then replace the old files with the 
new ones. This will keep the database correct.


A "wrong" way to do it is to import the filtered data, apply updates 
directly, and periodically delete data from the DB. The problem with 
this is that if someone adds one of the selected POI tags to a building 
that you have filtered out, osm2pgsql won't have the node data to create 
a geometry. This might be acceptable, depending on use case.


A less wrong way would be to modify your filtering so no nodes are 
filtered out. There are still potential errors with relations, but these 
are less common. If you're doing the planet or a large extract and using 
flat nodes there's no storage penalty for having all the nodes.
___
talk mailing list
talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] osm2pgsql diff application with filtered OSM data

2018-11-08 Thread Andy Townsend

On 08/11/2018 16:16, Darafei "Komяpa" Praliaskouski wrote:


Usually people also clip minutely osc, as per day database grows by a 
small country otherwise.


There's a worked example of that (in a slightly different context) at 
https://wiki.openstreetmap.org/wiki/User:SomeoneElse/Ubuntu_1804_tileserver_load#Updating_your_database_as_people_edit_OpenStreetMap 
.  That uses https://github.com/zverik/regional - I'm guessing you'll be 
able to "borrow" everything you need from there.


Best Regards,

Andy


___
talk mailing list
talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] osm2pgsql diff application with filtered OSM data

2018-11-08 Thread Nick Whitelegg
Hello Darafei and Frederik,


OK - thanks for that.


What I will do therefore, to avoid unwanted data, is to generate a filtered 
planet extract and import that into the DB, and then generate another filtered 
extract and find the diff between the two. Advantage of that is that I'll only 
need to  do the first filtering run on the server, and subsequent runs on my 
local machine (assuming the resulting diff is small enough to upload from my 
local machine to the server).


Thanks,

Nick



From: Darafei "Komяpa" Praliaskouski 
Sent: 08 November 2018 16:16:48
To: Nick Whitelegg
Cc: osm-talk
Subject: Re: [OSM-talk] osm2pgsql diff application with filtered OSM data

Hi Nick,

osm2pgsql is tolerant to features absent in database. You can in theory even 
start with empty set of tables and just insert new diff data.

Usually people also clip minutely osc, as per day database grows by a small 
country otherwise.

чт, 8 нояб. 2018 г. в 17:37, Nick Whitelegg 
mailto:nick.whitel...@solent.ac.uk>>:


... sorry, when I say "full planet extracts" I mean only England, Wales, 
Scotland, Ireland (all) and Greece - not the entire planet.

Thanks,

Nick


From: Nick Whitelegg
Sent: 08 November 2018 14:34:17
To: osm-talk
Subject: osm2pgsql diff application with filtered OSM data



Hi,


Looking towards overhauling the import system I use for my Freemap site 
(free-map.org.uk) which is itself going to go through 
an overhaul in the near future by moving to Tangram and hopefully applying hill 
shading.


At the moment I download full planet extracts about every 6 months. However, 
due to the limitations of my server, I filter out (with osmosis) a lot of stuff 
I don't need so that I am basically left with roads, footpaths, natural 
features, water features and selected POIs.


I'd like to move towards a system which applies diffs from geofabrik instead, 
and applies them regularly (daily or weekly) with osm2pgsql.


My question is this; given that not everything in the diff will be in my 
database (as I filter out what I don't need during the import process), will 
osm2pgsql apply the diff successfully or will it complain that not all features 
in the diff are in my database?


Thanks,

Nick

___
talk mailing list
talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk
--
Darafei Praliaskouski
Support me: http://patreon.com/komzpa
___
talk mailing list
talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] osm2pgsql diff application with filtered OSM data

2018-11-08 Thread Frederik Ramm
Hi,

On 08.11.2018 15:34, Nick Whitelegg wrote:
> My question is this; given that not everything in the diff will be in my
> database (as I filter out what I don't need during the import process),
> will osm2pgsql apply the diff successfully or will it complain that not
> all features in the diff are in my database?

It will apply the diff as far as possible, but it will also add a lot of
unwanted/unnecessary stuff from the diff to the database which you would
then have to filter out again.

There's also a danger that you will miss some things. For example,
consider a rural garage (shop=car_repair) mapped as a way with four
nodes; you filter that out because you're not interested. Half a year
later the shop closes, and a tourism=hostel opens instead. Assuming you
are interested in this kind of POI, the diff that you process contains
the way with the new tags, but not the nodes since these have not
changed. The hostel will not appear in your osm2pgsql database because
the geometry cannot be built due to lack of nodes.

One way to avoid this downloading the full files, filtering them, and
then generating a diff by comparing the filtered file to the last
filtered file, and importing *that* diff.

Bye
Frederik

-- 
Frederik Ramm  ##  eMail frede...@remote.org  ##  N49°00'09" E008°23'33"

___
talk mailing list
talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] osm2pgsql diff application with filtered OSM data

2018-11-08 Thread Komяpa
Hi Nick,

osm2pgsql is tolerant to features absent in database. You can in theory
even start with empty set of tables and just insert new diff data.

Usually people also clip minutely osc, as per day database grows by a small
country otherwise.

чт, 8 нояб. 2018 г. в 17:37, Nick Whitelegg :

>
> ... sorry, when I say "full planet extracts" I mean only England, Wales,
> Scotland, Ireland (all) and Greece - not the entire planet.
>
>
> Thanks,
>
> Nick
>
> --
> *From:* Nick Whitelegg
> *Sent:* 08 November 2018 14:34:17
> *To:* osm-talk
> *Subject:* osm2pgsql diff application with filtered OSM data
>
>
>
> Hi,
>
>
> Looking towards overhauling the import system I use for my Freemap site (
> free-map.org.uk) which is itself going to go through an overhaul in the
> near future by moving to Tangram and hopefully applying hill shading.
>
>
> At the moment I download full planet extracts about every 6 months.
> However, due to the limitations of my server, I filter out (with osmosis) a
> lot of stuff I don't need so that I am basically left with roads,
> footpaths, natural features, water features and selected POIs.
>
>
> I'd like to move towards a system which applies diffs from geofabrik
> instead, and applies them regularly (daily or weekly) with osm2pgsql.
>
>
> My question is this; given that not everything in the diff will be in my
> database (as I filter out what I don't need during the import process),
> will osm2pgsql apply the diff successfully or will it complain that not all
> features in the diff are in my database?
>
>
> Thanks,
>
> Nick
>
> ___
> talk mailing list
> talk@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/talk
>
-- 
Darafei Praliaskouski
Support me: http://patreon.com/komzpa
___
talk mailing list
talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Garmin GPS and OSM-based maps

2018-11-08 Thread Oleksiy Muzalyev

Hi Andy,

Thank you. It was helpful.

It is definitely better than a smartphone, mostly to the battery (14-16 
hours) & EGNOS correction. I learned how to install the OSM map on the 
device, - basically export/copy/paste the .img file.


I also acquired an accessory, - a big aluminum clip to attach the device 
to a backpack. It is quite convenient to keep it outside, well visible 
to satellites.


Best regards,
O.


On 06.11.18 13:46, Andy Townsend wrote:


Whilst it's great that Garmin are offering the convenience 
pre-installed OSM-based maps, it's worth bearing in mind that there 
are lots of free download options - see 
https://wiki.openstreetmap.org/wiki/Mkgmap for creating your own and 
https://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/Download for 
ready-made downloadable options.


http://garmin.openstreetmap.nl/ is a good place to start for "I want 
maps for a certain part of the world".


There are lots of help questions about the mechanics of installing 
maps on Windows, Linux, MacOS etc. at https://help.openstreetmap.org/ 
, and these might be an easier place to start reading than the wiki 
(which can be a bit confused at times).


I do have a GPSMap64s with preinstalled Garmin maps* that aren't 
OSM-based.  One problem with those is that they contain lots of old, 
inaccurate non-OSM POIs that it's impossible to turn off without 
removing the SD card - hopefully your OSM-based maps from Garmin won't 
share this problem.


Re EGNOS on an Etrex 35, assuming it's similar to an Etrex 30x, it's 
noticeably more accurate (within a few meters as opposed to a few tens 
of meters) when you're somewhere with WAAS/EGNOS coverage compared to 
when you're not (in my case it was Europe with and Australia without, 
but that was a while ago - don't know if the Australian situation has 
changed).


Barometric altimeter (on both Etrex30x and GPSMap64s) tend to be 
accurate to within 10m at the top of the hill if you've calibrated 
them at the bottom, but not if you haven't (apologies for being 
Captain Obvious there!).


Battery use on both Etrex30x and GPSMap64s are something like "one 
pair of rechargeable AA batteries every day and a half" (if it's on 
all day).


Re the new 66s my understanding is that it can use 2 of 
GPS/Glonass/Galileo at the same time.  Personally I'd wait to see a 
"review involving OSM-based map use" before getting one, but I'm sure 
they'll appear fairly soon.


Other non-Garmin options for "something to last all day" might be an 
old phone with GPS in it and user-removable batteries.  An old 
Blackberry might be an option (they still work after you manage to 
drop them on the floor, and you might find the keyboard more usable 
than a touchscreen when it's cold).


Best Regards,

Andy

* at the time this was essentially "free" due to availability and what 
stock the various discounters carried - in theory its about £60 extra, 
and probably isn't worth that.



On 06/11/2018 11:37, Oleksiy Muzalyev wrote:

Thank you, dikkeknodel.

I also received an email message with an advice to acquire Garmin 
eTrex.  I've ordered the Garmin eTrex 35 Touch with the pre-installed 
«TopoActive» Karte Europa, which is based on the OSM data, as I 
understood:

https://www.brack.ch/garmin-hand-gps-etrex-touch-370929

It supports the EGNOS, European Geostationary Navigation Overlay 
Service, which is supposed to correct the GPS signal. I have no idea 
how it works in reality. It also has got the GPS and barometric 
altimeters.


Best regards,
Oleksiy



On 05.11.18 19:59, _ dikkeknodel wrote:


Hi all,

Thanks for all the great advice. I’ve looked into uMap and it does 
the job perfectly. With all the gpx of over a year of hiking 
imported it still runs smoothly.


I would like to prevent running into performance issues later 
though. Does anybody know if it is wise to add ‘simplified’ versions 
of the gpx to uMap instead of the original recordings with 1 s 
resolution?


Since the published data is public, I just have to take into account 
not to import gpx which start from my home since I value my ‘sort of 
anonymity’.


*@Oleksiy*

To answer Oleksiy’s question, I record with OSMand on a Moto G4 
smartphone, that works like a charm. Off course there is fluctuation 
due to accuracy errors, I guess 10-15 m is achievable most of the 
time, but close to near vertical mountains it becomes much worse.


It however does never happen that I miss long stretches of data 
(except for tunnels 😝). I did have that problem in the past, when 
<15% battery charge and Android automatically started the battery 
saving mode. That just turned of the gps antenna whenever the screen 
was off. So now I have set battery saving mode to off.


Also OSMand does not drain the battery much. Usually I do take a lot 
of notes which OSMand attaches to the gpx and loads perfectly into 
JOSM. Recently I also used the voice recorder of OSMand, which 
really speeds up the note taking while on the go in comparison to 
typing. These als

Re: [OSM-talk] osm2pgsql diff application with filtered OSM data

2018-11-08 Thread Nick Whitelegg

... sorry, when I say "full planet extracts" I mean only England, Wales, 
Scotland, Ireland (all) and Greece - not the entire planet.

Thanks,

Nick


From: Nick Whitelegg
Sent: 08 November 2018 14:34:17
To: osm-talk
Subject: osm2pgsql diff application with filtered OSM data



Hi,


Looking towards overhauling the import system I use for my Freemap site 
(free-map.org.uk) which is itself going to go through an overhaul in the near 
future by moving to Tangram and hopefully applying hill shading.


At the moment I download full planet extracts about every 6 months. However, 
due to the limitations of my server, I filter out (with osmosis) a lot of stuff 
I don't need so that I am basically left with roads, footpaths, natural 
features, water features and selected POIs.


I'd like to move towards a system which applies diffs from geofabrik instead, 
and applies them regularly (daily or weekly) with osm2pgsql.


My question is this; given that not everything in the diff will be in my 
database (as I filter out what I don't need during the import process), will 
osm2pgsql apply the diff successfully or will it complain that not all features 
in the diff are in my database?


Thanks,

Nick

___
talk mailing list
talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk


[OSM-talk] osm2pgsql diff application with filtered OSM data

2018-11-08 Thread Nick Whitelegg

Hi,


Looking towards overhauling the import system I use for my Freemap site 
(free-map.org.uk) which is itself going to go through an overhaul in the near 
future by moving to Tangram and hopefully applying hill shading.


At the moment I download full planet extracts about every 6 months. However, 
due to the limitations of my server, I filter out (with osmosis) a lot of stuff 
I don't need so that I am basically left with roads, footpaths, natural 
features, water features and selected POIs.


I'd like to move towards a system which applies diffs from geofabrik instead, 
and applies them regularly (daily or weekly) with osm2pgsql.


My question is this; given that not everything in the diff will be in my 
database (as I filter out what I don't need during the import process), will 
osm2pgsql apply the diff successfully or will it complain that not all features 
in the diff are in my database?


Thanks,

Nick

___
talk mailing list
talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk