Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Length of numeric fields #1220

Open
maurizio737 opened this issue Oct 19, 2018 · 4 comments
Open

Length of numeric fields #1220

maurizio737 opened this issue Oct 19, 2018 · 4 comments
Labels

Comments

@maurizio737
Copy link

I need in c# when I create a shapefile to define the length of the characters in integer field, if I use (int32) in the code I am created in the .dbf a length equal to 11, here is my code:
FeatureSet fsSet = new FeatureSet(FeatureType.Line);
fsSet.CoordinateType = CoordinateType.Z;
Feature f = new Feature();
System.Data.DataColumn DIAMETER = new System.Data.DataColumn("DIAMETER", typeof(Int32));
fsSet.DataTable.Columns.Add(DIAMETER);
DotSpatial.Topology.Point point = new DotSpatial.Topology.Point(1, 1, 0);
Feature f = new Feature(point);
fsSet.Features.Add(f);
f.DataRow.BeginEdit();
f.DataRow["DIAMETER"] = 32;
f.DataRow.EndEdit();
fsSet.Projection = KnownCoordinateSystems.Projected.UtmWgs1984.WGS1984UTMZone33N;
fsSet.SaveAs(lbPercorso.Text + "\XXXXX.shp", true);

@sindizzy
Copy link
Contributor

What is the purpose of the length? Is it for displaying it on the map?

@maurizio737
Copy link
Author

No, I have to import it into a software that also checks the length of the integer fields

@maurizio737
Copy link
Author

I currently use third-party software to change this length

@sindizzy
Copy link
Contributor

Use the Field object to better define your field #221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants