WebFaction
Community site: login faq

Hi,

Attempting this tutorial - http://invisibleroads.com/tutorials/geodjango-googlemaps-build.html

Using source code from the code and data link a few lines down. I'm on D1.3.1 with PostGIS added by tech support.

Basic site works. Points appear on map and can be added via Admin. So lots of stuff working. But GPX upload results in a 500 with OGRException: Could not open the datasource at .filename.

So I repeated the DataSource in the shell.

from django.contrib.gis.gdal import DataSource datasource = DataSource('test.gpx') - file uploaded to application folder

This resulted in ERROR 6: OGR/GPX driver has not been built with read support. Expat library required.

So, a lot more information to go on at least.

I found this but looks fairly involved http://canadianamp.ca/?p=74

Any ideas. I'd have thought reading GPX files would be standard stuff for GeoDjango installations. One for the TechSupport guys to build into PostGIS updates perhaps?

Stuart

asked 06 Oct '11, 05:21

Parthian
16410
accept rate: 0%


I've checked the build specs for our GDAL RPM, and it looks like it's not built with expat support enabled. I'll ticket this for our sysadmins, but I can't guarantee that it will be implemented any time soon (or at all).

As a workaround, you might be able to either:

  • Convert your GPX files to a different format that doesn't require expat, or
  • Build your own PostgreSQL+PostGIS stack from source, with whatever build options you need, and then run that as a custom application to manage your databases.
permanent link

answered 06 Oct '11, 16:36

seanf
12.2k41836
accept rate: 37%

Sean, All,

Conversion may be the thing to do short term. Thanks.

Seems odd GDAL can't cope with GPS data out of the box. Looks like a no brainer to me. Am I the first person on Webfaction to want to load GPS data with GeoDjango?

Found http://www.gdal.org/ogr/drv_gpx.html http://www.gdal.org/ogr/ogr_formats.html

It appears that KML won't work either (also needs the expat library).

GPX and KML don't work with GDAL out of the box! Even curiouser.

But - I ran $ ogrinfo --formats and both GPX and KML were listed as read/write supported (note the $ and not >>> - there is an ogrinfo in the django.contrib.gis.utils folder but it doesn't appear to be the real thing).

Has anyone used GPX or KML with a standard Webfaction PostGIS install?

Stuart

(07 Oct '11, 05:51) Parthian

Hi Stuart,

I can't tell for sure, but I've searched our ticket database and didn't find any questions about GPX or KML. It's possible someone has been using it with their custom-built PostgreSQL stack though.

(07 Oct '11, 06:11) todork

todork,

I'd have thought that before going for their own Stack a forum question or ticket would have been raised, just as I have. Maybe. Must be an uncommon thing to do with GeoDjango.

This seems to happen to me a lot, I try stuff that I assume everyone would do and have a problem and it turns out nobody does it. I must be a revolutionary.

Really liking GeoDjango though.

(07 Oct '11, 07:33) Parthian
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×8
×1
×1

question asked: 06 Oct '11, 05:21

question was seen: 2,380 times

last updated: 07 Oct '11, 07:33

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM