How to pick up attribute from a shape file

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to pick up attribute from a shape file

nathan.alexandre
Hello everyone,
Could you, please, tell me how  to pick up an attribute, from a shape file, and use it as a variable ?
Thanks and Regards.
                    

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: How to pick up attribute from a shape file

Tatara, Eric R.

The Geography demo model in Repast 2.4 has an example of reading shapefile attributes in the ContextCreator class.  Repast includes the GeoTools library for loading shapefiles and feature attributes can be read using the SimpleFeature.getAttribute(“attribute_name”) method.  See http://docs.geotools.org/stable/javadocs/org/opengis/feature/simple/SimpleFeature.html for more details.  Note that getAttribute() returns an Object, so you will need to cast the Object according to the data type which you must know from the shapefile feature attributes.  For example

 

String name = (String)feature.getAttribute(“name”);

 

eric

 

From: [hidden email] [mailto:[hidden email]]
Sent: Friday, June 2, 2017 2:19 AM
To: Repast Interest <[hidden email]>
Subject: [Repast-interest] How to pick up attribute from a shape file

 

Hello everyone,
Could you, please, tell me how  to pick up an attribute, from a shape file, and use it as a variable ?
Thanks and Regards.
                    


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

How to pick up attribute from a shape file in RepastCity3

nathan.alexandre
In reply to this post by nathan.alexandre
Hello everyone,
Could you, please, tell me how  to pick up an attribute, from a shape file, and use it as a variable ?
I precise that I use RepastCity3.

Thanks and Regards.                      
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: How to pick up attribute from a shape file in RepastCity3

Tatara, Eric R.

The Geography demo model in Repast 2.4 has an example of reading shapefile attributes in the ContextCreator class.  Repast includes the GeoTools library for loading shapefiles and feature attributes can be read using the SimpleFeature.getAttribute(“attribute_name”) method.  See

http://docs.geotools.org/stable/javadocs/org/opengis/feature/simple/SimpleFeature.html  for more details.  Note that getAttribute() returns an Object, so you will need to cast the Object according to the data type which you must know from the shapefile feature attributes.  For example

 

String name = (String)feature.getAttribute(“name”);

 

eric

 

From: [hidden email] [mailto:[hidden email]]
Sent: Sunday, June 25, 2017 2:40 AM
To: Repast Interest <[hidden email]>
Subject: [Repast-interest] How to pick up attribute from a shape file in RepastCity3

 

Hello everyone,
Could you, please, tell me how  to pick up an attribute, from a shape file, and use it as a variable ?
I precise that I use RepastCity3.

Thanks and Regards.                      


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest