2

I'm exporting layers of a project for a quantum gis postgis table and visualizing the data in gmaps, but the coordinates are very wrong.

Is there any special way to export the quantum gis? The postgres table is using 4326 SRID like gmaps.

My shape in gmaps:

qgis:

Glorfindel
  • 1,096
  • 2
  • 9
  • 14
Ciro Vargas
  • 203
  • 1
  • 3
  • 10

1 Answers1

4

settings->project settings: here enable "on the fly CRS Transformation" and now you choose wgs84 (epsg 4326).

now import your shapefile.

in the left pane rightclick on your shapefile-layer and click save as in the context-menu: choose for format: kml and for CRS you select: Project CRS.

Now you should be able to load this kml-file into google maps and google earth.

good luck, hope this helps!

enter image description here

edit: oops your are using database-layer, nevertheless it should work the same way .. edit2: if you are using windows you could use ogr2gui too (see my answer in this thread Converting projection?, you just have to select the correct database source)

Kurt
  • 7,087
  • 4
  • 33
  • 51
  • i make this, setted the project crs: http://i46.tinypic.com/10z8voo.png and exported the layer as project crs:http://i46.tinypic.com/2zrzygj.png and the result is the same – Ciro Vargas Sep 21 '12 at 16:36
  • no, i use a shape file .shp, i read this in qgis, export kml, import kml to postgis via PHP, and return data in web on a gmap – Ciro Vargas Sep 21 '12 at 16:52
  • @Ciro Vargas: I suppose that the problem occurs later in your workflow. for clarifaction: please load the from qgis exported kml to a webserver. now paste this url into the search box of google maps, e.g. http://www.yourwebserver/yourfile.kml. does it look ok? – Kurt Sep 21 '12 at 17:27
  • @Ciro Vargas: you could also check your kml with google earth, does it look okay? – Kurt Sep 21 '12 at 17:29
  • yes, the error is in my workflow, www.itenho.com.br/teste7.kml see, hmn i pick the coordinates make POLYGON(()) in postgis, because this cause error? – Ciro Vargas Sep 21 '12 at 18:16
  • @Ciro Vargas: suggestion: did you try to use EPSG:3857 in your postgis-database ??? epsg:3857 = pseudo-mercator / web-mercator – Kurt Sep 21 '12 at 19:11
  • @CiroVargas: did EPSD3857 solve your problem? – Kurt Sep 23 '12 at 06:49
  • dont tryed yet, i try sunday, i have imported via ST_GeomFromKML, and thats ok, before use ST_GeomFromText – Ciro Vargas Sep 23 '12 at 06:53