Python 2.7 works for ogr2osm (if the bindings are installed properly). Thanks 
for the hint.

 

Now ogr2osm produces output. But it also produces warnings about “interior 
rings”. My shape file has inner and outer polygons. What can I do about this?

 

 

 

D:\ENC>c:\python27\python ogr2osm\ogr2osm.py shp\fairwy.shp

Preparing to convert file 'D:\ENC\shp\fairwy.shp' to 'D:\ENC\fairwy.osm'.

Will try to detect projection from source metadata, or fall back to EPSG:4326

Using default translations

Using default filterLayer

Using default filterFeature

Using default filterTags

Using default filterFeaturePost

Using default preOutputTransform

Detected projection metadata:

GEOGCS["GCS_WGS_1984",

    DATUM["WGS_1984",

        SPHEROID["WGS_84",6378137,298.257223563]],

    PRIMEM["Greenwich",0],

    UNIT["Degree",0.017453292519943295]]

Warning 1: organizePolygons() received an unexpected geometry.

Either a polygon with interior rings, or a polygon with less than 4 points,

or a non-Polygon geometry.  Return arguments as a collection.

Warning 1: organizePolygons() received an unexpected geometry.

Either a polygon with interior rings, or a polygon with less than 4 points,

or a non-Polygon geometry.  Return arguments as a collection.

 

 

 

 

 

Von: Paul Norman [mailto:[email protected]] 
Gesendet: Montag, 5. März 2012 23:00
An: RheinSkipper
Cc: Paul Norman
Betreff: Re: AW: [Imports] Using Rewritten ogr2osm

 

By installing python from both python.org and the gdal package you've got two 
versions of python installed. What command did you use to start python before 
the import gdal test? 

 

Python 2.7 is what I'd suggest for gdal, but 2.5 or 2.6 should work.

 

Alternately, your problem could be caused by running ogr2osm under Python 3. 
I'm not at home right now so I'm not sure if the lambda syntax still works in 
Python 3.

 

A third possibility is that you have both problems.


Sent from my iPad


On Mar 5, 2012, at 11:33 AM, RheinSkipper <[email protected]> wrote:

You are correct. Typing “import gdal” from the shell produces the same error.

 

So I started again with a clean Windows and installed the following packages:

 

>From http://python.org/download/ I installed Python 3.2.2 x86-64.

>From 
>http://www.gisinternals.com/sdk/PackageList.aspx?file=release-1600-x64-gdal-1-9-mapserver-6-0.zip
> I installed the core components:   
><http://www.gisinternals.com/sdk/Download.aspx?file=release-1600-x64-gdal-1-9-mapserver-6-0\gdal-19-1600-x64-core.msi>
> gdal-19-1600-x64-core.msi

I also installed the corresponding python bindings for my python version:  
<http://www.gisinternals.com/sdk/Download.aspx?file=release-1600-x64-gdal-1-9-mapserver-6-0\GDAL-1.9.0.win-amd64-py3.2.msi>
 GDAL-1.9.0.win-amd64-py3.2.msi

 

Then I run gdalshell.bat from the gdal directory to setup the environment 
variables.

 

Starting the console and typing „import gdal“ now produces no errors. Just 
“>>>” as a prompt.

 

But trying ogr2osm fails again:

 

D:\ENC\ogr2osm>c:\python32\python ogr2osm.py --help

  File "ogr2osm.py", line 282

    reproject = lambda(geometry): None

                      ^

SyntaxError: invalid syntax

 

 

Do you suggest using another python or gdal version? Is one already tested with 
ogr2osm under Windows?

 

I know that the ogr2osm wiki suggests not running it under Windows. But I hoped 
only the original version may have problems, not the rewritten one. I´d really 
like to stay with Windows if somehow possible.

                                                                                
                                                                     

 

 

Von: Paul Norman  <mailto:[mailto:[email protected]]> [mailto:[email protected]] 
Gesendet: Montag, 5. März 2012 03:33
An: 'RheinSkipper'; [email protected]
Betreff: RE: [Imports] Using Rewritten ogr2osm

 

Your error is likely caused by the python you are running not having the 
gdal-python bindings. Try running c:\python27\python and then typing import 
gdal. If it responds with a >>> then gdal is working. If not, then the python 
install you are running does not have the bindings. This can be caused by 
multiple python installations, you may need to use the python version that came 
with the osgeo tools.

 

If you are eventually planning to use ogr2osm to prepare data for import, you 
will want to share the translations file in ogr2osm/translations/ that you 
create when you do the required consultation with imports@ and the local 
community.

 

_______________________________________________
Imports mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/imports

Reply via email to