Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I need to include array type in file geodatabase/shapefile field's content so that when i expose it as a map service, i can get array instead of string or integer.

e.g., i got fields: OBJECTID, field1, field2, shape 0,["a","b"],"simple field",polyline

and when i get after publishing service as a json, it should be like:

OBJECTID: 0, field1: ["a","b"], field2: "simle field", shape:...

remember, field1: ["a","b"] should not be like field1: "[\"a\",\"b\"]"

share|improve this question
1  
Array is not a field type. The best you can do is store it as a string and then use split (in C#, VB, python..) to make it into an array. If you were to use a PostgreSQL database you might be able to have an array field but not for a file geodatabase. –  Michael Miles-Stimson Jul 1 at 4:11
2  
If you were to use an array in PostgreSQL, ArcGIS would not be able to access the table (unsupported type). The traditional 1:M formulation in relational databases is a join with 1:M cardinality (which ArcGIS would model with a relationship class) –  Vince Jul 1 at 4:30
    
Seems like it should be possible to get an array into a BLOB field. Here's an example of putting an image into a BLOB field using arcpy: anothergisblog.blogspot.com/2012/06/… –  Dan Jurgella Jul 1 at 13:32
    
Here's a way you can use python to convert a list and store it in a BLOB field: stackoverflow.com/questions/11076107/… Not sure about the ease of extracting this data, though. I haven't really tested it. –  Dan Jurgella Jul 1 at 14:06
    
Dan Jurgella, Blob is not going to expose using map service if we, somehow, manage to add textual data into it. and blob is never gonna return you an array, it'd be just stream of characters. –  user54559 Jul 2 at 4:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.