crackernutter / EsriRESTScraper

A Python class that scrapes ESRI Rest Endpoints and exports data to a geodatabase
MIT License
48 stars 20 forks source link

Problem with GlobalIDs #8

Closed SprtnBit closed 3 years ago

SprtnBit commented 5 years ago

I ran into an issue with scraping a rest with a GUID fieldtype while creating a feature class. I added

elif 'global' in name.lower(): fieldType = "GUID"

to the _createField function and it worked.

SprtnBit commented 5 years ago

Actually, adding

'esriFieldTypeGlobalID' to

def __setUpdateFields(self, serviceFields):
        """Sets the fields that will be updated from the FeatureService.  This does not include ID or Geometry fields"""
        updateFields = []
        for field in serviceFields:
            if (field['type'] in ['esriFieldTypeOID', 'esriFieldTypeGeometry', 'esriFieldTypeGUID', 'esriFieldTypeGlobalID'] or 'shape' in field['name'].lower() or field['name'] in self.userFields + self.excludeFields):
                pass
            else:
                updateFields.append(field)
        updateFields.insert(
            0, {"name": 'Shape@', "type": "esriFieldTypeGeometry"})
        self.updateFields = updateFields

worked far better.

crackernutter commented 5 years ago

Thanks for letting me know! Is the endpoint with GUIDs publicly available, and if so, would you mind sharing it? I'll run some testing on my end and incorporate your changes.

mikepianka commented 4 years ago

I had a similar issue and fixed it by adding 'esriFieldTypeGlobalID' to the list in __setUpdateFields.