Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Error importing shepafile to postgis

François,
Following this issue, I upgrade to the new release of SDI (2.2.4). I add the tLogrow and add statistic to the log, here is the log:

Starting job test_shp2pgsql at 11:34 01/02/2008.
connecting to socket on port 3760
connected
Aucune autorité n'a été spécifiée pour le code "-1". Le format attendu est habituellement "AUTORITÉ:NOMBRE".
Table test_import was dropped
1 févr. 2008 11:34:15 org.geotools.data.postgis.PostgisDataStore createSchema
INFO: CREATE TABLE "public"."test_import" ("test_import_fid" serial PRIMARY KEY, "the_geom" GEOMETRY NOT NULL, "gid" INTEGER, "sous_zone_num" INTEGER, "sous_zone_nom" VARCHAR(10485760), "zone_nom" VARCHAR(10485760));
1 févr. 2008 11:34:15 org.geotools.data.postgis.PostgisDataStore createSchema
INFO: DELETE FROM GEOMETRY_COLUMNS WHERE f_table_catalog='' AND f_table_schema = 'public'AND f_table_name = 'test_import';
1 févr. 2008 11:34:15 org.geotools.data.postgis.PostgisDataStore createSchema
INFO: INSERT INTO GEOMETRY_COLUMNS VALUES ('','public','test_import','the_geom',2,-1,'MULTIPOLYGON');
1 févr. 2008 11:34:15 org.geotools.data.postgis.PostgisDataStore createSchema
INFO: ALTER TABLE "public"."test_import" ADD CONSTRAINT "enforce_dims_the_geom" CHECK (ndims("the_geom") = 2);
1 févr. 2008 11:34:15 org.geotools.data.postgis.PostgisDataStore createSchema
INFO: ALTER TABLE "public"."test_import" ADD CONSTRAINT "enforce_geotype_the_geom" CHECK (geometrytype("the_geom") = 'MULTIPOLYGON'::text OR "the_geom" IS NULL);
1 févr. 2008 11:34:15 org.geotools.data.postgis.PostgisDataStore createSchema
INFO: CREATE INDEX spatial_test_import_the_geom ON "public"."test_import" USING GIST ("the_geom");
gid sous_zone_num sous_zone_nom zone_nom the_geom
Source CRS is: EPSG:NTF (Paris) / Lambert zone II code: NTF (Paris) / Lambert zone II authority: European Petroleum Survey Group version: null
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
disconnected
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at test_yja_1.test_shp2pgsql.test_shp2pgsql.sShapefileInput_1_GIProcess(test_shp2pgsql.java:666)
at test_yja_1.test_shp2pgsql.test_shp2pgsql.runJob(test_shp2pgsql.java:1066)
at test_yja_1.test_shp2pgsql.test_shp2pgsql.main(test_shp2pgsql.java:993)
Job test_shp2pgsql ended at 11:34 01/02/2008.


The shapefile is a personnal file I create from postgisDB (quartier de la defense). Thanks,
Y.

Labels (2)
13 Replies
Anonymous
Not applicable
Author

Hi Yves,
You're probably trying to launch your job with java 1.5.
Try to use the java 6 version to run SDI (update-alternatives --config java) it will be better.
We will fix this problem soon to be compatible with java 1.5.
Cheers,
Mathieu
Anonymous
Not applicable
Author

Hi Mathieu,
You are right 0683p000009MACn.png I am using java 1.5.
Y;
Anonymous
Not applicable
Author

Ok I upgraded java to 1.6, I tested my test job and here are some small issues:
1- attribut data are not imported, I have no error message, do you have an idea?
2- if I use Long for my key field (gid field), the job failed:
Starting job test_shp2pgsql at 14:05 01/02/2008.
connecting to socket on port 3776
connected
disconnected
Exception in component sPostgisOutput_1_SO
java.io.IOException: Type 'class java.lang.Long' not supported!
at org.geotools.data.postgis.PostgisDataStore.makeSqlCreate(PostgisDataStore.java:1518)
at org.geotools.data.postgis.PostgisDataStore.createSchema(PostgisDataStore.java:1191)
at test_yja_1.test_shp2pgsql.test_shp2pgsql.sShapefileInput_1_GIProcess(test_shp2pgsql.java:453)
at test_yja_1.test_shp2pgsql.test_shp2pgsql.runJob(test_shp2pgsql.java:1066)
at test_yja_1.test_shp2pgsql.test_shp2pgsql.main(test_shp2pgsql.java:993)
Job test_shp2pgsql ended at 14:05 01/02/2008.

Any ideas? 0683p000009MACn.png
Y.
Anonymous
Not applicable
Author

1- attribut data are not imported, I have no error message, do you have an idea?

Did you defined your schema in the output component ?
You should have at least a fid column and the_geom column.
Can you give us more details ?
2- if I use Long for my key field (gid field), the job failed:
Y.

This is a known bug in GeoTools :
http://jira.codehaus.org/browse/GEOT-1508
... so you need to wait for this to be solved. A workaround could be to use a tMap component to change datatype to long to something else ...
Ciao.
Francois
Anonymous
Not applicable
Author

Hi François,
Thanks for your answer. For the second problem, I am testing the application so I can wait.
About the first issue, indeed I get two columns: the_geom and test_import_fid which they are correct.
I defined the output component clicking the "sync columns" button. I followed this tutorials wrote by Elem.
Anonymous
Not applicable
Author

Hi,
Anybody have an idea about this issue?
Y.
Anonymous
Not applicable
Author

Hi Yves,
Sorry but I'm not sure to understand what is the issue....
You've got two output columns which are the_geom and test_import_fid in your postgis output table called test_import I guess.
So what do you want to achive?
How much input columns do you have in your shape?
Do you want to import all of them in postgis?
If not, try to use a tMap between input and output component to define your mapping.
Maybe I'm wrong and I don't understant what you want to do...
Please be more precise about what you define in input/output, and what is the issue according to you.
Cheers,
Mathieu
Anonymous
Not applicable
Author

Hi,
Indeed, mu shapfile contains three others columns:
* sous_zone_num (int)
* sous_zone_nom (string)
* zone_nom (string)
I would like to import them into my postgis table but following the tutorials, they are not imported. My fields are empty except for the the_geom and fid column.
Regards,
Y.
Anonymous
Not applicable
Author

Yves,
If your three columns are defined in your output schema and created in your output table in postgis, I can only think that they are empty....
Try to put a tLogRow directly connect to your Shapefile Input.
This step will allow you to check whether your three columns are not empty.
Otherwise try to activate traces during the execution of your job, this will give you more details about what is "in the flow"!
Cheers,
Mathieu