Hey Ian,
Thanks for the insight. This is the first time I am working on creating a shape 
file and hence not aware of the restrictions.
I do have common identifier column present in both the dbf files. Can I use 
associationType?
My requirement is creating standalone product containing the geometry and the 
information. I am using qGIS to just view it, but can use any other shape file 
viewer.
Geopackage and spatialite formats look promising for my use case, as can 
independently share the files, similar to shape.
Which out of two do you think is easier to handle (read/write, config)?

Thanks and regards,
/Paresh..

On 28-Feb-2017, at 10:22 PM, Ian Turton 
<[email protected]<mailto:[email protected]>> wrote:

Neither of those approaches will work with Shapefiles. The shapefile format is 
a very old (and almost obsolete) format so it can only load a single dbf file 
that has exactly the same basename as the .shp file. It will also only manage 
to contain a set of simple features (that have the same geometry type) so you 
can't use the complex feature types to write one as you found out.

The only way to make what you are trying work in QGIS is to use the table join 
functionality to add dbf files that share a common identifier column to the 
shapefile.

Alternatives that you could consider (I don't know enough about your problem to 
be certain) are geopackage and spatialite databases or a proper spatial 
database like PostGIS. All three are supported by GeoTools.

Ian

On 28 February 2017 at 15:09, Paresh Patel 
<[email protected]<mailto:[email protected]>> wrote:
Hello,
        I have a requirement of generating multiple dbf files for a single 
shape file, and a metadata file too.
I was looking towards using complex type, but was not able to find writer for 
that. I have ended up generating SimpleFeatureType for generating shape file, 
then DBaseFileWriter to write dbf file. But then I am not able to view the 
extra dbf file data in qGIS (although the file has data).
How do I associate these two dbf files? Or should I use complexType?
There is a one to may relationship between a record in parent geometry and 
other dbf file record.

Thanks and regards,
Paresh..
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org<http://SlashDot.org>! http://sdm.link/slashdot
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users



--
Ian Turton

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to