I've done a blank Django project. Then shared it via git on
Then downloaded a very small region from geofabrik
in Windows I've imported it via:
osm2pgsql -c -U xx -d yy -H localhost -W -E
in Linux I had to change
3857to make it work, otherwise coordinates in the admin interface didn't show up properly.
From there I've made my models:
Here's are my models (all the same fields for
Roads, just one is enough):
class PlanetOsmLine(models.Model): class Meta: db_table = 'planet_osm_line' managed = False osm_id = models.BigIntegerField(primary_key=True) # ...tons of other field (unused)... way = GeometryField(default=None)
Now, for the same
osm_id, this requests works under Windows, and gives me many results but under Linux I have an empty array (!!):
source = PlanetOsmPolygon.objects.get(osm_id="717295797").way print([a.osm_id for a in PlanetOsmPolygon.objects.filter( way__contains=source )])
What am I doing wrong, what are the tests I should do to make it work/look for the problem? I dont know where to start.