Assistance with Reading GeoJSON Properties in GAMA

22 views
Skip to first unread message

jinya Wang

unread,
Feb 5, 2025, 8:22:28 AM2/5/25
to GAMA
Dear all,

I hope this email finds you well.

I am currently working with GAMA to process a GeoJSON file, but I have encountered an issue where I can only seem to access the geometry data (coordinates) and not the properties within the file.

Here is the structure of my GeoJSON file:

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -119.99,
                    55.05
                ]
            },
            "properties": {
                "facility_ID": "ABRAND00001",
                "subtype_code": 601,
                "equipment_groups": 1
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -119.98,
                    54.74
                ]
            },
            "properties": {
                "facility_ID": "ABRAND00002",
                "subtype_code": 601,
                "equipment_groups": 3
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -119.96,
                    55.25
                ]
            },
            "properties": {
                "facility_ID": "ABRAND00003",
                "subtype_code": 601,
                "equipment_groups": 1
            }
        }

}

  In my GAMA model, I use the following command to load the file:

file infrastructure_file <- geojson_file("../includes/facilities.geojson", 4326);   

I can successfully access the geometry data, but I am unsure how to extract the facility_ID, subtype_code, and equipment_groups from the properties section of the GeoJSON file.  

Could you kindly advise on how to properly access the properties data in GAMA? If there are any specific indexing techniques or functions required, I would greatly appreciate a detailed explanation or example.  

Thank you for your time and assistance. Looking forward to your response.

Best regards,

Julia Wang  

Reply all
Reply to author
Forward
0 new messages