One Star

Shape to PostGIS

If I have a shape file with one or more fields "string" type and I import into PostGIS get all fields string set to varchar (10485760): why? How do I get a value other than 10485760 (for example varchar (30)? Is Possible?
Another question: can I import into PostGIS more shape files in one job?
Thanks
Best regards
I use:
SDI 2.3.2
sShapefileInput
sPostgisOutput

  • SDI
8 REPLIES
One Star Fxp
One Star

Re: Shape to PostGIS

Hi, For the time being String fields are mapped to varchar(10485760) as this is the default GeoTools mapping. We are currently working on improving that point and allowing to insert/update/append data to an existing PostGIS table.
> Another question: can I import into PostGIS more shape files in one job?
Yep, just add another ShapefileInput and another sPostgisOutput components.
If you want to merge two Shape into one postgis table use a tMerge Component in between.
Ciao.
Francois
One Star

Re: Shape to PostGIS

Hi Fxp,
for the second answer: if I have a list of shape file (more then 10-20) and I want to put in PostGis in which mode I can put them in one time?
Thanks
Bye
One Star Fxp
One Star

Re: Shape to PostGIS

Hi,
For more than 10 shapefiles, you could use a tFileList component, select your directory, search pattern will be *.shp and could be recursive. Then iterate tFileList on tShapefileInput and then use tMerge to append all shape's features.
That way, it will search for all file *.shp, read all shape one after the other and the tMerge will append all geometries. You should have shapefile with the same attributes.
HTH.
Francois
One Star

Re: Shape to PostGIS

Hi,
if I have, for example, more than 10 different shapefiles and I want to put in more 10 different PostGIS layers how I can to do? How to set different schema in automatic mode?
Thanks
Bye
One Star Fxp
One Star

Re: Shape to PostGIS

Hi, what is automatic mode ?
If you have 10 inputs and 10 outputs components, just define all transformations on the workspace.
Schema will be defined for each inputs and outputs components. If you always use the same schema, you can save it as a flat XML file (from the schema editor) or use the metadata section in the repository to save it.
HTH.
Francois
One Star

Re: Shape to PostGIS

Hi,
If I have more than 10 different inputs and many different outputs? Is there an automatic mode for retrieve the schema of all inputs?
Thanks
Bye
One Star

Re: Shape to PostGIS

I have the same interest.
My question is... How can I retrieve a Shape's Schema?
Thanks,
Bye
One Star

Re: Shape to PostGIS

Hi,
There is no "automatic mode" at this time in SDI as Metadata for DB, csv files....
This functionality will be available soon in SDI.
--
Mathieu