Ticket #92 (new defect)

Opened 5 months ago

Last modified 4 months ago

Error reading shapefile on Mac OS X with G5 processor

Reported by: Claire Mclister Owned by: artem
Milestone: 1.0.0 Component: Shapefile Input Driver
Version: 0.5.0 Severity: Blocker
Keywords: PPC, encoding, envelope, mac os Cc: blake@…, mclister@…

Description

I've built mapnik on Mac OS X (Leopard) running on a G5 processor.

While trying to read the shapefile from the mappinghacks website (as suggested by the Getting Started page), I am getting an invalid envelope:

Shapefile(file='world_borders')

size = 2

file=world_borders

type=shape

Envelope(4.157455691574588e-317,-1.62334203800658e-118,4.157518931977256e-317,4.15549523909189e-317)

file_length=3332172

shape_type=5

datasource=0x332fd0 type=1

<mapnik.Datasource object at 0x64270>

Attachments

demo.log (34.3 kB) - added by Claire Mclister 5 months ago.
Output of running 'python rundemo.py'
rundemo_dane.log (15.1 kB) - added by springmeyer 5 months ago.
Output of running demo.py on intel 10.5 machine

Change History

Changed 5 months ago by springmeyer

  • cc blake@… added

Claire,

Try setting the shell env like this:

export DYLD_PRINT_APIS=y

before running the demo. Attach the full output of the python interpreter.

Also, confirm that you have tried running the demo.py as well or at least another world shapefile.

Changed 5 months ago by Claire Mclister

Output of running 'python rundemo.py'

Changed 5 months ago by Claire Mclister

I have attached the output from running the rundemo.py

Yes, confirmed, I have tried it with several shapefiles and for all the Envelope output doesn't look correct.

Changed 5 months ago by Claire Mclister

  • cc mclister@… added

Changed 5 months ago by springmeyer

  • keywords PPC, encoding, envelope, mac os added

Hmmm. Nothing definitive in those logs (that I can see). I ran the demo on my machine, saved the same output and compared the text using BBedit. The most suspicious line (besides all the messed up extents) is line 355 where your log reports 'utf8' encoding then bails on processing the shapefile, while mine simply reports 'dlsym(0x32b7f0, create)'. Not sure what that means, but makes me wonder whether the some unicode reworking in Mapnik code is causing problems on Mac OS. I installed the boost ICU variant and ( I think) ICU separately as well using macports (can't recall exactly). Did you install ICU? Can you confirm that your libiconv is working as well?

My log is attached if you care to search through the haystack.

Changed 5 months ago by springmeyer

Output of running demo.py on intel 10.5 machine

Changed 5 months ago by Claire Mclister

I took a look at the logs, and was browsing the source code for reading shapefiles as well. Seems to me, the issue is being caused by an incorrect reading of doubles. Looks like integer values (file length) are being read properly, but doubles are getting messed up. Can anyone suggest a way to debug this? I'd be happy to modify the source code and try out different things.

Changed 4 months ago by Claire Mclister

It seems that the macro WORDS_BIGENDIAN is not being defined in Mac OS X with G5 processor, although it should. So, I manually defined it for the two files that it occurs in plugins/input/shape/shapefile.hpp and src/wkb.cpp and I can get the maps to work now.

Will try to figure out how to make sure the macro is defined in this case. Until then, will keep the hack on my copy.

Add/Change #92 (Error reading shapefile on Mac OS X with G5 processor)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change. Next status will be 'new'
The owner will change to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.