Hi,
I tried to read data from a shape file and save them into database. well here is my code
for feat in lyr:
geom_t = feat.geom.transform(wgs84, clone=True)
print(geom_t.wkt)
print(feat.geom.wkt)
name =''
Twoway='1'
data = {
'name': name,
'Twoway': Twoway,
'geom': geom_t.wkb
}
form = Street_Form(data)
if form.is_valid():
savedlocation = form.save()
well it saves and works fine. I printed some of my geometries as wkt before saving to databse and here is the result
LINESTRING (50.9847540637495 35.8384680697353,50.9850968571006 35.8383655346687)
LINESTRING (50.9847540637495 35.8384680697353,50.9850968571006 35.8383655346687)
As you can see they are EPSG:4326 and nothing is wrong.
Here is my model
class str(models.Model):
geom = models.LineStringField(srid=4326)
but when I read data from database they are as following
"LINESTRING(0.000457917485762628 0.000321907544087987,0.000457920236524686 0.000321915031075541)"
the above result is from this query
select st_astext(geom) from public."app_str"
well the geometries are misplaced, where is the problem?why this happens?