gvSIG bugs #1445

export to postgis error

Added by Klaus Schaefer over 11 years ago. Updated over 10 years ago.

Status:New% Done:

0%

Priority:High
Assignee:-
Category:-
Target version:-
Severity: Add-on name:Unknown
gvSIG version:1.12.0 Add-on version:
gvSIG build:1417 Add-on build:
Operative System:Windows Add-on resolve version:
Keywords:layer export postgis postgreSQL Add-on resolve build:
Has patch:No

Description

Added a table from MS Access.
Referenced latitude and longitude.
Try export to PostGIS -- error appears.

Adding and spacial referencing the same table data using PostgreSQL/PostGIS native (plain SQL) works without problems.
The table can then be added as a layer to gvSIG with no problems, too.

The error appears in version 1.11 and 1.12. Not jet tested with 2.0.

2012-12-03_gvSIG.log - gvSIG 1.12 Logfile (61.8 KB) Klaus Schaefer, 12/03/2012 03:22 PM

Error_layer_export_to_PostGIS.pdf - on screen error message (657 KB) Klaus Schaefer, 12/03/2012 03:22 PM

2012-12-10-002_gvSIG.log (61.1 KB) Klaus Schaefer, 12/10/2012 12:55 PM

History

#1 Updated by Klaus Schaefer over 11 years ago

  • Assignee deleted (Klaus Schaefer)

#2 Updated by Juan Lucas Domínguez over 11 years ago

  • Target version deleted (2.0.0-rc1)

Hello, I have removed the "target version" because you have tested gvSIG 1.12 (not gvSIG 2.0.0).
I can export a shapefile to PostGIS in gvSIG 2.0.0 correctly.
You can add "Supporting event themes (table with numeric columns --> layer)" as a feature request in gvSIG 2.0.0

#3 Updated by Klaus Schaefer over 11 years ago

Cannot really understand your last sentence...

Maybe my report was not so clear to understand: I have imported an MS Access table as "table" into gvSIG. Then I georeferenced it with lat/lon definition included in the data ("Add points from table..."). All that works fine within gvSIG.

Then I try to export the layer as postgis table or shape file - both fails!!! Why?
the corresponding error messages are:

1. PostgreSQL/PostGIS
-----------------------------
Can´t process writer visitor the layer: PostGIS Writer
at com.iver.cit.gvsig.fmap.drivers.jdbc.postgis.PostGISWriter.process(PostGISWriter.java:192)
at com.iver.cit.gvsig.ExportTo$WriterTask.run(ExportTo.java:209)
at com.iver.andami.PluginServices$1.construct(PluginServices.java:405)
at com.iver.utiles.swing.threads.SwingWorker$2.run(SwingWorker.java:108)
at java.lang.Thread.run(Unknown Source)
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "MR"

at org.postgresql.util.PSQLException.parseServerError(PSQLException.java:139)
at org.postgresql.core.QueryExecutor.executeV3(QueryExecutor.java:152)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:100)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:43)
at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:517)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:50)
at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:298)
at com.iver.cit.gvsig.fmap.drivers.jdbc.postgis.PostGISWriter.process(PostGISWriter.java:156)

2. Shape File
----------------
DEBUG AWT-EventQueue-1 com.iver.andami.messages.NotificationManager - Bug in program code.: Field type 93 not supported in DBF writer
java.lang.RuntimeException: Field type 93 not supported in DBF writer

It seems to be a specific issue with the table I am working with, but why? Other tables do work fine. And, as mentioned above, using PostgreSQL/PostGIS native (plain SQL) works without problems. The table can then be added as a layer to gvSIG with no problems, too.

I have attached another logfile for reference and hope you find time to look into this issue.

Best regards
Klaus

#4 Updated by Juan Lucas Domínguez over 11 years ago

Hello. Yes, I misunderstood your message, sorry.

The problem 2 is because your original MS Access table has a field of a type which is not supported by DBF files (SHP uses DBF for attributes). It is probably a field of type TIMESTAMP. If you remove or change the type of that field, then it should work. Actually this is a bug, because the export process should solve the situation (perhaps ignoring that field or converting it to date or long integer).

I don't know what happens in problem 1. The log file is not very useful in this case. Perhaps you can attach your original MS Access file to this ticket? Or send it to me in case you don't want to make it public (I will not publish it, of course).

Regards,

#5 Updated by Álvaro Anguix over 10 years ago

  • Project changed from Application: gvSIG desktop to | gvSIG desktop 1
  • Category deleted (Database)

Also available in: Atom PDF