#11168: postgis geometry alternatively seen as linestring then multilinestring
---------------------------------+------------------------------------------
          Reporter:  anonymous   |         Owner:  nobody           
            Status:  new         |     Milestone:                   
         Component:  GIS         |       Version:  1.0              
        Resolution:              |      Keywords:  GEOS API, Postgis
             Stage:  Unreviewed  |     Has_patch:  0                
        Needs_docs:  0           |   Needs_tests:  0                
Needs_better_patch:  0           |  
---------------------------------+------------------------------------------
Comment (by ludifan):

 I solved the problem by forcing all the linestrings to multilinestrings in
 the postgis table and setting the field type to MultiLineString in django.
 I'm not sure the problem comes from the geometry itself but may be from
 the type of the data table in postgis (GEOMETRY).


 You could eventually download the data here:
 
[http://services.sandre.eaufrance.fr/data/zonage/Hydrographie2008/arcinfo/FranceEntiere/courdo00.e00.zip]
 and import it to postgis using ogr:

 {{{
 set PGCLIENTENCODING=LATIN1
 ogr2ogr -f PostgreSQL "PG:dbname=eau_france user=postgres
 password=postgres" -nlt GEOMETRY cours_d_eau.shp

 }}}
 (you have to force type geometry)

 then see if you can reproduce the thing

 this was my model definition for this feature:


 {{{
 class CoursDo(models.Model):
     id = models.IntegerField(db_column="ogc_fid", primary_key=True)
     toponyme = models.CharField(db_column="toponyme", max_length=127)
     codehydro = models.CharField(db_column="code_hydrographique",
 max_length=8)
     classification = models.CharField(db_column="classification",
 max_length=1)
     geom = models.GeometryField(db_column="wkb_geometry", srid=32767)
     objects = models.GeoManager()

     class Meta:
         db_table = "cours_d_eau"
         verbose_name_plural = r"Cours d'eau"
         verbose_name = r"Cours d'eau"

     def __unicode__(self):
         return self.toponyme.strip()

 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11168#comment:3>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to