Re: [OSM-dev] Generating SRTM elevation tiles in xyz format

2018-11-04 Thread Ian Dees
Yep, I have no reason to think they'd change away from free.

On Sun, Nov 4, 2018 at 5:42 AM Nick Whitelegg 
wrote:

>
> Hello Ian,
>
>
> Many thanks for these. So these will indeed remain free to access for the
> foreseeable? Very, very useful if so.
>
>
___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Generating SRTM elevation tiles in xyz format

2018-11-04 Thread Nick Whitelegg

Hello Ian,


Many thanks for these. So these will indeed remain free to access for the 
foreseeable? Very, very useful if so.

Thanks,

Nick



From: Ian Dees 
Sent: 03 November 2018 12:43:27
To: Nick Whitelegg
Cc: dev
Subject: Re: [OSM-dev] Generating SRTM elevation tiles in xyz format

I'd encourage you to look further into the Mapzen Terrain Tiles: 
https://mapzen.com/documentation/terrain-tiles/

I ran the most recent update of Terrain Tiles almost immediately before we shut 
down, so they have fairly recent/modern data in them. Also, they're completely 
free: Amazon agreed to host them on S3 without any "requester pays" 
restrictions. You can read more about that here: 
https://registry.opendata.aws/terrain-tiles/.

If you find those don't meet your needs, I'd be interested in hearing why.

-Ian

On Sat, Nov 3, 2018 at 7:31 AM Nick Whitelegg 
mailto:nick.whitel...@solent.ac.uk>> wrote:

Hi,


As part of a couple of projects I'm developing (a modernisation of Freemap 
which hasn't seen much attention in recent years, and new work on my Hikar AR 
project for walkers; https://gitlab.com/nickw1/Hikar) I'd like to create SRTM 
elevation tiles in XYZ tile format. There are various mapping providers which 
serve these (but subject to usage limits/cost) and OpenMapTiles provide a 
download at cost, but to avoid these limitations I'd like to roll my own.


Obviously I could develop code to convert the .hgt files to XYZ tiles in 
Spherical Mercator, but it would be good to see if others have done the same 
thing to avoid reinventing the wheel.


Looks like Mapzen might have done a bit of work on this 
(https://github.com/mapzen/terrarium) though this doesn't match exactly what 
I'm looking for; could be used as a starting point.


Alternatively, does anyone provide a free download of XYZ tiled elevation data 
as static tiles a la Geofabrik?


Don't mind if it''s GeoJSON or some other format.


Thanks,

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


Re: [OSM-dev] RuntimeError: need at least two points for linestring (way_id=619453148)

2018-11-04 Thread Sarah Hoffmann
Hi,

On Fri, Nov 02, 2018 at 11:36:49AM +0900, koji higuchi wrote:
> Hi Sarah,
> It stopped working with the following error, though I used try and
> exception:
> 
> Traceback (most recent call last):
>   File "D:\test.py", line 47, in 
> ShapeConverter().apply_file(fi, locations=True)
> RuntimeError: Read failed: The data is invalid.

This means that one of your input files is broken.
You need to find out which one and repair it.

Sarah

> 
> Please help me.
> 
> On Thu, Nov 1, 2018 at 7:59 PM koji higuchi  wrote:
> 
> > Hi Sarah,
> > Your answer was great and it helped me to correct my code.
> > I think that it's okay to use class and definition.
> > Thank you very much for your help.
> >
> > Best regards
> > Koji
> >
> >
> > On Thu, Nov 1, 2018 at 7:07 PM koji higuchi  wrote:
> >
> >> Hi Sarah,
> >> Thank you so much for your help!
> >> Writing speed for GPKG format with fiona has been very slow.
> >> I wanted to extract one by one ids and write geom and tag using
> >> ogr/python.
> >> Could you help me how to extract geom and tag of each id in a for loop
> >> without using class and definitions?
> >>
> >> On Thu, Nov 1, 2018 at 6:07 PM Sarah Hoffmann  wrote:
> >>
> >>> Hi,
> >>>
> >>> On Thu, Nov 01, 2018 at 12:13:40PM +0900, koji higuchi wrote:
> >>> > *I tried to extract data from .osm.pbf file and write to shapefile as
> >>> > follows:*
> >>> >
> >>> > import os, osmium, fiona
> >>> >
> >>> > fi = 'europe-latest.osm.pbf'
> >>> > fo = 'europe-latest.shp'
> >>> >
> >>> > drv = 'ESRI Shapefile'
> >>> >
> >>> > crs = {'no_defs': True, 'ellps': 'WGS84', 'datum': 'WGS84', 'proj':
> >>> > 'longlat'}
> >>> >
> >>> >  schema = {'geometry': 'LineString',
> >>> >'properties': {'id': 'float', 'name' : 'str',
> >>> 'kind' :
> >>> > 'str'}}
> >>> >
> >>> > outfile = fiona.open(fo, 'w', driver=drv, crs=crs, schema=schema)
> >>> >
> >>> > geomfab = osmium.geom.GeoJSONFactory()
> >>> >
> >>> > class ShapeConverter(osmium.SimpleHandler):
> >>> >   def way(self, w):
> >>> >if 'place' in w.tags:
> >>> >rec = {'geometry' : eval(geomfab.create_linestring(w)),
> >>> >   'properties' : {'id' : float(w.id),
> >>> >  'name' : w.tags.get('name'),
> >>> >'kind' : w.tags['place']}}
> >>> >outfile.write(rec)
> >>> >
> >>> > ShapeConverter().apply_file(fi, locations=True)
> >>> >
> >>> > I got the following error after extracting several contents:
> >>> >
> >>> >  rec = {'geometry' : eval(geomfab.create_linestring(w)),
> >>> > RuntimeError: need at least two points for linestring
> >>> (way_id=619453148)
> >>> >
> >>> > How could I skip that erroneous id and extract data for other working
> >>> ids?
> >>>
> >>> You need to do this manually yourself in the handler. I recommend
> >>> simply catching the exception as there are some other error
> >>> conditions besides too few points:
> >>>
> >>> def way(self, w):
> >>> if 'place' in w.tags:
> >>> try:
> >>> geom = geomfab.create_linestring(w)
> >>> except:
> >>> print("Skipping way with bad geometry")
> >>> return
> >>>
> >>>   rec = {'geometry' : eval(geom),
> >>>'properties' : {'id' : float(w.id),
> >>>'name' : w.tags.get('name'),
> >>>'kind' : w.tags['place']}}
> >>> outfile.write(rec)
> >>>
> >>> Kind regards
> >>>
> >>> Sarah
> >>>
> >>

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


Re: Add templated version of wiki href to link element in presets

2018-11-04 Thread Dirk Stöcker

On Sat, 3 Nov 2018, Vincent Privat wrote:


Yes it's slower and slower over time.
I guess it can be improved a lot by using MediaWiki API, see
https://josm.openstreetmap.de/ticket/16702


That would help the Wiki side maybe, but probably not us. We do ATM one 
call per link. I only see a speedup when we could get all the i18n links 
at once somehow. I check the docs, but didn't find a solution.


There is an easy way for speedup. Use WWW::Mechanize instead of wget 
calls. But that increases the frequency of page calls and is not so good 
an idea. That's exactly what I use as rule to block IPs and WIKI admins 
wont be so different :-)


Ciao
--
http://www.dstoecker.eu/ (PGP key available)