[OSM-dev] How to compile osm2pgsql without persistent node cache?
Hi, Since I do not have lseek64 on the system that runs osm2pgsql, I cannot compile the latest version that uses a flat file persistent node cache. However, I do not care about the persistent node cache, since I'm only importing extracts and it's not well suited for that. So can anyone tell me how I can compile osm2pgsql without the flat node cache? Cheers, Steven ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] How to compile osm2pgsql without persistent node cache?
Hi Kai, Never mind, it works on a clean checkout. It must have been caused by not starting with a clean state. I indeed use FreeBSD, which does not have lseek64, but I was using the latest version that had the commit you mention applied, and got to the error: #error Flat nodes cache requires a 64 bit capable seek Supposedly I could only get there if no support for large files was available, but apparently some state of a previous build was still left, even though I cleaned and reconfigured. Now, with a clean checkout, everything works fine. Thanks for the explanation. Cheers, Steven Op zondag 2 september 2012 18:09:11 schreef Kai Krueger: Hi, on what platform are you trying to compile osm2pgsl? Some systems that don't have lseek64 seem to use a 64bit off_t pointer anyway. So the normal lseek is fine for large files. I have added a compile check for this condition a couple of days ago [1]. If your system doesn't support large files at all, then one would indeed have to disable the compilation of the persistent node cache. This currently isn't possible, but shouldn't be difficult to add. Kai [1] https://github.com/openstreetmap/osm2pgsql/commit/74873cfed07ab3fd8d21cf266 ba7075ec9bc6a1e On 9/2/12 3:03 AM, Steven te Brinke wrote: Hi, Since I do not have lseek64 on the system that runs osm2pgsql, I cannot compile the latest version that uses a flat file persistent node cache. However, I do not care about the persistent node cache, since I'm only importing extracts and it's not well suited for that. So can anyone tell me how I can compile osm2pgsql without the flat node cache? Cheers, Steven ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] Tagtransform
Hello, Is the tagtransform plugin still maintained? Because it looks like the same problem as 3 months ago still exists: it does not work with the latest release of Osmosis. The plugin looks very useful to me, so if noone maintains it, I'll give refactoring it a try, but because I have no experience with coding Osmosis plugins, I would prefer if someone else could do this. Regards, Steven Dave Stubbs schreef: 2009/2/13 marcus.wolsc...@googlemail.com: On Thu, 12 Feb 2009 21:34:21 +0100, Rolf Bode-Meyer rob...@gmail.com wrote: That indeed looks promissing. Unfortunatelly one seems to have be a programmer to use osmosis. Every problem is presented as a Java exception. Some of them contain at least a faint idea of what could be wrong. But something like this leaves me clueless: java.lang.AbstractMethodError at com.bretth.osmosis.core.pipeline.common.TaskManagerFactory.createTaskManager(TaskManagerFactory.java:72) This looks like the plugin was compiled against a different version of osmosis. My guess would be, that it was build against the latest development-version and you are using the last stable release of osmosis. Something like this. It's something Randomjunk the developer of the plugin has to fix. I have not seen any contact-info on his wiki-user-page so I hope he reads this mailing-list. It was built against v0.29 of Osmosis which is the version I'm still using -- it should work with that. I hadn't realised the plugin interface had changed. I'll have to take a look some time. Dave ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] asking for open layers
Hello, OpenLayers can easily be used off-line, just change the URL where it should retrieve the tiles from to a local URL. Steven ahmed soua schreef: Hi all, my question is : is it possible to work with Open layers and obtain slippy map of my country without an internet connection . ( I have downloaded the file tunisia .osm and put the data into a postgres data base and generate the necessary tiles with mapnik) Thanks. -- Le bonheur est comme l'écho : il vous répond : mais il ne vient pas. ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev
[OSM-dev] Generate image and tiles scripts
Hello, I've changed the generate_tiles and generate_image scripts to suit my needs and like to share them. The changes are: - they can be called from the command line - generate_tiles can resume at a given tile - generate_image zoom levels work more like the slippy map zoom levels As a side effect, a dependency on optparse is added. If anyone with svn access likes these changes, they can be added there. Otherwise, they just stay on the mailinglist for those interested. Greetings, Steven #!/usr/bin/python # # Generates a single large PNG image for a UK bounding box # Tweak the lat/lon bounding box (ll) and image dimensions # to get an image of arbitrary size. # # To use this script you must first have installed mapnik # and imported a planet file into a Postgres DB using # osm2pgsql. # # Note that mapnik renders data differently depending on # the size of image. More detail appears as the image size # increases but note that the text is rendered at a constant # pixel size so will appear smaller on a large image. from mapnik import * from optparse import make_option,OptionParser import sys, os def render_image(ll, mapfile, map_uri=image.png, z=10): prj = Projection(+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m [EMAIL PROTECTED] +no_defs +over) c0 = prj.forward(Coord(ll[0],ll[1])) c1 = prj.forward(Coord(ll[2],ll[3])) yfactor = (c1.y - c0.y) / 78097 xfactor = (c1.x - c0.x) / (c1.y - c0.y) imgy = int(yfactor * (2 ** (z - 1))) imgx = int(imgy * xfactor) m = Map(imgx,imgy) load_map(m,mapfile) bbox = Envelope(c0.x,c0.y,c1.x,c1.y) m.zoom_to_box(bbox) im = Image(imgx,imgy) render(m, im) view = im.view(0,0,imgx,imgy) # x,y,width,height view.save(map_uri,'png') return (imgx, imgy) # return size of generated image if __name__ == __main__: try: mapfile = os.environ['MAPNIK_MAP_FILE'] except KeyError: mapfile = osm.xml #--- # Change this to the bounding box you want # bbox = (-6.5, 49.5, 2.1, 59) map_uri = image.png zoom = 10 option_list = [ make_option(-b, --bbox, type=float, nargs=4, dest=bbox, metavar=minLon minLat maxLon maxLat, help=Bounding box to render, default=bbox), make_option(-u, --map_uri, type=string, dest=map_uri, help=URI to save the image to, default=map_uri), make_option(-z, --zoom, type=int, dest=zoom, help=Zoom level to render, default=zoom), ] parser = OptionParser(option_list=option_list) (options, args) = parser.parse_args() render_image(options.bbox, mapfile, options.map_uri, options.zoom) #!/usr/bin/python from math import pi,cos,sin,log,exp,atan from subprocess import call from optparse import make_option,OptionParser import sys, os DEG_TO_RAD = pi/180 RAD_TO_DEG = 180/pi def minmax (a,b,c): a = max(a,b) a = min(a,c) return a class GoogleProjection: def __init__(self,levels=18): self.Bc = [] self.Cc = [] self.zc = [] self.Ac = [] c = 256 for d in range(0,levels): e = c/2; self.Bc.append(c/360.0) self.Cc.append(c/(2 * pi)) self.zc.append((e,e)) self.Ac.append(c) c *= 2 def fromLLtoPixel(self,ll,zoom): d = self.zc[zoom] e = round(d[0] + ll[0] * self.Bc[zoom]) f = minmax(sin(DEG_TO_RAD * ll[1]),-0.,0.) g = round(d[1] + 0.5*log((1+f)/(1-f))*-self.Cc[zoom]) return (e,g) def fromPixelToLL(self,px,zoom): e = self.zc[zoom] f = (px[0] - e[0])/self.Bc[zoom] g = (px[1] - e[1])/-self.Cc[zoom] h = RAD_TO_DEG * ( 2 * atan(exp(g)) - 0.5 * pi) return (f,h) from mapnik import * def render_tiles(bbox, mapfile, tile_dir, minZoom=1,maxZoom=18, name=unknown, start=(0,0), quiet=False): if not quiet: print render_tiles(,bbox, mapfile, tile_dir, minZoom,maxZoom, name, start,) if not os.path.isdir(tile_dir): os.mkdir(tile_dir) gprj = GoogleProjection(maxZoom+1) m = Map(2 * 256,2 * 256) load_map(m,mapfile) prj = Projection(+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m [EMAIL PROTECTED] +no_defs +over) ll0 = (bbox[0],bbox[3]) ll1 = (bbox[2],bbox[1]) for z in range(minZoom,maxZoom + 1): px0 = gprj.fromLLtoPixel(ll0,z) px1 = gprj.fromLLtoPixel(ll1,z) # check if we have directories in place zoom = %s % z if not os.path.isdir(tile_dir + zoom): os.mkdir(tile_dir + zoom) for x in range(max(start[0],int(px0[0]/256.0)),int(px1[0]/256.0)+1): # check if we have directories in place str_x = %s % x if not os.path.isdir(tile_dir + zoom + '/' + str_x): os.mkdir(tile_dir + zoom + '/' + str_x)
Re: [OSM-dev] why does api not return nodes that are referenced from ways?
I've found some missing nodes too and like to fix the problem. Is there an easy way to undelete them? Steven Frederik Ramm schreef: Hi, Uh oh. I guess I need to teach pyroute to somehow ignore such nodes completely. Any chance you could track down how exactly that node got deleted? It seems to have happened with Potlatch (0.4b), end of August last year. I think I remember there was a bug that did these things in certain network timeout situations or so but I cannot remember, you may want to check the mailing lists around that date if you're really interested. You can access the history of the way using http://www.openstreetmap.org/api/0.5/way/10660210/history Bye Frederik ___ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev