Tag Info

New answers tagged

2

If you are trying to calculate correct distance by projecting geographic coordinates (lon-lat) to map coordinates (E-N) and then using plane coordinate geometry, then you either need to project using an appropriate equidistant map projection -- probably not a good idea if you have points at arbitrary locations and distances in arbitrary directions or ...


4

When you start with a Python module, there are several solutions to find the available functions. One of them is dir: geom = feat.GetGeometryRef() print dir(geom) ['AddGeometry', 'AddGeometryDirectly', 'AddPoint', 'AddPoint_2D', 'Area', 'AssignSpatialReference', 'Boundary', 'Buffer', 'Centroid', 'Clone', 'CloseRings', 'Contains', 'ConvexHull', 'Crosses', ...


1

The shapefile format has some limitations due to the underlying dbase database format. See: http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Geoprocessing%20considerations%20for%20shapefile%20output In your case, the limit of 10 characters field name and 255 fields total is hit. Try some other format, like spatialite. Or think about ...


1

Converting OSM to PBF is probably not necessary, most tools that can read PBFs can also read OSM XML. If you do need to read the file with osmosis, the issue here is that ogr2osm by default generates files that can be loaded in JOSM and merged with existing OSM data. These files have no timestamp or version attributes as well as having negative IDs, while ...


0

The OSM wiki lists some more tools for converting shape files to .osm. Maybe try another one?


0

Have you tried this? Shp2OSM & PG2OSM You may need one step in Postgre ...


0

The .osm file you create with the script does not have version/user/timestamp attributes. Osmosis does not like that. I guess you have to look for other ways to get your map file. I'm not sure how you want to do the last step anyway.


2

I suggest adding to the end of your script:- o3_proj.Destroy() o3_proj = None As from other OGR tutorials I've read when working on my scripts, these calls at the end are suggested as necessary to ensure not just memory release, but also writing out data. Let us know how it goes - as your use of SetFeature() does appear correct as far as I can tell. And ...



Top 50 recent answers are included