One Star

Error exporting postgis table to shapfile

hi,
when i run my job, i have this message :
Starting job PG_TO_SHP at 14:04 24/10/2008.
connecting to socket on port 4801
connected
Exception in component sShapefileOutput_1_SO
java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
at java.util.ArrayList.add(Unknown Source)
at org.geotools.feature.DefaultFeatureTypeFactory.add(DefaultFeatureTypeFactory.java:43)
at org.geotools.feature.FeatureTypeBuilder.addType(FeatureTypeBuilder.java:392)
at testpg.pg_to_shp.PG_TO_SHP.sPostgisInput_1_PGProcess(PG_TO_SHP.java:410)
at testpg.pg_to_shp.PG_TO_SHP$1.run(PG_TO_SHP.java:1174)
java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
at java.util.ArrayList.add(Unknown Source)
at org.geotools.feature.DefaultFeatureTypeFactory.add(DefaultFeatureTypeFactory.java:43)
at org.geotools.feature.FeatureTypeBuilder.addType(FeatureTypeBuilder.java:392)
at testpg.pg_to_shp.PG_TO_SHP.sPostgisInput_1_PGProcess(PG_TO_SHP.java:410)
at testpg.pg_to_shp.PG_TO_SHP$1.run(PG_TO_SHP.java:1174)
1391 milliseconds
disconnected
Job PG_TO_SHP ended at 14:04 24/10/2008.
i need some helps to resolve this error.
Regards,
Jérôme Rolland

  • SDI
7 REPLIES
One Star Fxp
One Star

Re: Error exporting postgis table to shapfile

Hi Jérôme, hum still quite hard to figure out what's wrong with only this message.
Could you make a first test: connect your postgres input component to a tLogRow component and see what happens ? tLogRow output everything in the run job console. If that's ok, then it's a problem on the output one.
HTH.
Francois
One Star

Re: Error exporting postgis table to shapfile

Hi francois,
Like you preconize i tested with tLogRow, it's ok
two screenshot with no errors and a third with errors

regards,
Jérôme
One Star

Re: Error exporting postgis table to shapfile

Hi francois,
Smiley Wink All the screenshots now :



regards,
One Star

Re: Error exporting postgis table to shapfile

Hi Jérôme,
You can not handle Geometric objects with tPostgreSQL* components.
Indeed, you should use sPostgis* components to handle geometry columns in SDI 1.2.0.
In the new upcoming release, the 1.3.0, you will be able to use tPostgreSQL* components using the "Geometry" type for your geometry columns.
So for now, you will have to wait until 1.3.0 or to switch to sPostgis* components.
FYI, the 1.3.0 release is coming very soon! Smiley Wink
Cheers,
Mathieu
One Star

Re: Error exporting postgis table to shapfile

Hi Mathieu,
Thanks for your help,
indeed, if I use the sPostgisInput component in the place of tPostgresInput component,
the shapefile is created.
But for this, i must specify that my geometry field (wkb_geometry) is an object type in the place of an string type.
It is the Retrieve Shema command that initialize my geometry field like an string type, why not
like an object type ?

Smiley Wink I am impatient to test the 1.3.0 release...
regards,
One Star Fxp
One Star

Re: Error exporting postgis table to shapfile

Hello,
But for this, i must specify that my geometry field (wkb_geometry) is an object type in the place of an string type.

Yep in SDI 1.2 **ALL** Geometry should be define as a "the_geom" column name of type "Object". Object is a generic Talend Type useful to do more or less everything :/. That's why in 1.3, we added a new Talend type called "Geometry" which has to be used for all your geometry columns.
Columns names are not important.
It is the Retrieve Shema command that initialize my geometry field like an string type, why not
like an object type ?

That point also changed in SDI 1.3 as we defined how to map a postgres geometry type to a Talend geometry type and should be supported in all metadata discovery wizard in Talend. Test and comments are welcomed. If you found any side effects on classical Talend component do not hesitate to post on the forum in order to check that this new Geometry type is not causing trouble in more generic talend process.

Smiley Wink I am impatient to test the 1.3.0 release...
regards,

Go online http://spatialdataintegrator.org
Cheers.
Francois
One Star

Re: Error exporting postgis table to shapfile

Hi francois,

Smiley Happy i had downloaded the new version,
and indeed version 1.3.0 brings the solution to the points evoked previously.
Smiley Happy Smiley Happy Smiley Happy Smiley Happy
regards,