Hi,

Please let me to create another mail concerning with garbled attribute name.
I successfully executed the latest Csv2Shp.java and created the shape file.
But when I tried to change the attribute name (dbf's field names) to
Japanese characters
It becomes garbled attribute name but the attribute values are OK
(Japanese character values can normally viewed by settings the charset
to Windows-31J).

Please refer to the below codes:

...
final SimpleFeatureType TYPE = DataUtilities.createType("the_goem",
"location:MultiLineString:srid=4326," + // <- the geometry attribute:
MultiLineString type
"名称:String," + // <- a String attribute (name)
"番号:Integer" // a number attribute (number)
);
...
for (line = reader.readLine(); line != null; line = reader.readLine()) {
...
featureBuilder.add("名称" + index++); //test data in Japanese chars
featureBuilder.add(number);
SimpleFeature feature = featureBuilder.buildFeature(null);
collection.add(feature);
...
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
try {
reader.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
....
Map<String, Serializable> params = new HashMap<String, Serializable>();
params.put("url", newFile.toURI().toURL());
params.put("charset", "Windows-31J"); // to support Japanese chars as
attribute values
params.put("create spatial index", Boolean.TRUE);

ShapefileDataStore newDataStore = (ShapefileDataStore)
dataStoreFactory.createNewDataStore(params);
....


I think, there's a settings that I need to set like the
params.put("charset", "Windows-31J"); to support Japanese attribute values.
Please guide me on the right directions.

Eros
Japan

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to