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

Defined enum GisAttributeType does not fit current Arcgis field types #2310

Closed
danielvillalbamota opened this issue Oct 5, 2023 · 1 comment

Comments

@danielvillalbamota
Copy link
Collaborator

public enum GisAttributeType {
DATE("Date"), INTEGER("Integer"), NUMBER("Number"), BOOLEAN("Boolean"), STRING("String"), OID(
"OBJECTID"), GID("GlobalID"), GEOMETRY("Geometry");

Defined enum GisAttributeType does not fit current Arcgis field types: https://doc.arcgis.com/en/dashboards/latest/get-started/field-types-and-coded-strings.htm

For example "string" in Arcgis is defined as "esriFieldTypeString".

This makes that strings that has to be quoted in some queries goes without quotes:

quoted = GisAttributeType.DATE.equals(uniqueFieldType)
|| GisAttributeType.STRING.equals(uniqueFieldType);

@danielvillalbamota
Copy link
Collaborator Author

It seems that is not the issue as the prefix "esriFieldType" of Arcgis it is removed in

public static GisAttributeType fromString(String strType) throws ArcgisException {
strType = strType.replace("esriFieldType", "");
switch (strType) {
case "Date":
return GisAttributeType.DATE;
case "Integer":
case "SmallInteger":
return GisAttributeType.INTEGER;
case "Number":
case "Double":
return GisAttributeType.NUMBER;
case "Boolean":
return GisAttributeType.BOOLEAN;
case "String":
return GisAttributeType.STRING;
case "OBJECTID":
case "OID":
return GisAttributeType.OID;
case "GlobalID":
return GisAttributeType.GID;
case "Geometry":
return GisAttributeType.GEOMETRY;
default:
throw new ArcgisException("Invalid string type: " + strType);
}
}

I close the issue

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

No branches or pull requests

1 participant