Geometry cannot be resolved to a type

Hello,
I installed successfully the newest TOS DI and the spatial module according to the install instruction. Thereafter I am able to build complex jobs with GeoOperations integrating PostGIS, shapefiles and so on, this works very good. But I am not able to retrace / rebuild this example to create a new geometry from a WKT representation of a point:
https://github.com/talend-spatial/talend-spatial/wiki/Create-lines-or-polygons-from-points
If I execute the job, then I get the error message: Geometry cannot be resolved to a type.
Does anyone has a similiar problem?
Best regards, Stefan

  • SDI
6 REPLIES
One Star Fxp
One Star

Re: Geometry cannot be resolved to a type

Hi, could you post a screenshot of your job or the list of components used ?
I can't reproduce issue with tRowGenerator > tMap > sShapefileOutput.
It sounds related that no spatial component is in used (only a call to new Geometry) and the spatial libs may not be loaded. Try to add a sGeomTxtInput (which does nothing) in your job, which will trigger the spatial lib to be loaded. Another option could be to use tLibraryLoad.
Cheers.
Francois

Re: Geometry cannot be resolved to a type

I have appended 2 images,
basically it is the same example as the link below is showing
https://github.com/talend-spatial/talend-spatial/wiki/Create-lines-or-polygons-from-points
Regards, Stefan
One Star Fxp
One Star

Re: Geometry cannot be resolved to a type

Basically it's the same, but does not output a shapefile. This last component trigger the load of the library required for Geometry type.
Try to add a sGeomTxtInput.
Cheers.
Francois

Re: Geometry cannot be resolved to a type

sorry, the second image failed while uploading

Re: Geometry cannot be resolved to a type

When using sGeomTxtInput I get the error message, that this method is not defined,
In the tMap out component I wrote following:
sGeomTxtInput("LINESTRING("+row1.x+" "+row1.y +","+row1.x2+" "+row1.y2+")")
Does the WKT representation is the valid input string for the sGeomTxtInput method?
Best regards, Stefan

Re: Geometry cannot be resolved to a type

Hi, this way works:
tRowGenerator -> tMap -> sShapeFileOutput
in the tMap I defined the new Geometry(WKT) as the geometry representation.
Thank you very much for helping.
Best regards, Stefan