Esri / arcgis-osm-editor

ArcGIS Editor for OpenStreetMap is a toolset for GIS users to access and contribute to OpenStreetMap through their Desktop or Server environment.
Apache License 2.0
399 stars 131 forks source link

General error in the node loading routine (Exception from HRESULT: 0x8002000A (DISP_E_OVERFLOW)) #194

Closed acanivano closed 5 years ago

acanivano commented 6 years ago

I’ve done a script that read a polygon geometry as extent of the OSMGPD Download (OSM Data for ArcGis 10.5 version) My problem is that when the tool gets an extension without OSM data (0 nodes, 0 ways, 0 relations), it fails. So, the script break at that point. By the logs message, I can see that when it can’t find any data use the repair geometry tool,"Repair geometry arcgis tool" and delete the empty geometry without success. This is my code. Any ideas, please

import arcpy
from arcpy import env

# load the OpenStreetMap specific toolbox
arcpy.ImportToolbox(r'c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Toolboxes\OpenStreetMap Toolbox.tbx')

cuadricula = r"D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb\grid_peru"
gdb_destino =  r"D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb\\"
try:
    with arcpy.da.SearchCursor(cuadricula,["SHAPE@","id_grid3"])as cursor:
        for row in cursor:
            ds = row[1]
            extent = row[0].extent
            print (ds)
            arcpy.OSMGPDownload_osmtools('http://www.openstreetmap.org', extent, 'DO_NOT_INCLUDE_REFERENCES', gdb_destino + str(ds), gdb_destino+ str(ds)  + str(ds) + "_osm_pt", gdb_destino+ str(ds)  + str(ds) + "_osm_ln", gdb_destino+ str(ds) + str(ds) + "_osm_ply")          
except (RuntimeError, TypeError, NameError):
    pass

print ("Script OK")

And, this is the message that Arcgis returns:

Messages Executing: OSMGPDownload http://www.openstreetmap.org "291739,210780744 9164768,91156832 296739,210780744 9169768,91156832" DO_NOT_INCLUDE_REFERENCES D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb_5 D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb_5_5_osm_pt D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb_5_5_osm_ln D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb_5_5_osm_ply Start Time: Mon Jun 18 11:28:43 2018 Debugging... Starting OSM Data download request... Counting elements in OSM file... Counted 0 nodes, 0 ways, and 0 relations. General error in the node loading routine (Fuera del intervalo actual. (Exception from HRESULT: 0x8002000A (DISP_E_OVERFLOW))). Executing: RepairGeometry D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb_5_5_osm_ln DELETE_NULL Start Time: Mon Jun 18 11:28:47 2018 Succeeded at Mon Jun 18 11:28:47 2018 (Elapsed Time: 0,01 seconds) Executing: RepairGeometry D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb_5_5_osm_ply DELETE_NULL Start Time: Mon Jun 18 11:28:47 2018 Succeeded at Mon Jun 18 11:28:47 2018 (Elapsed Time: 0,01 seconds) Updating remaining references... Fuera del intervalo actual. (Exception from HRESULT: 0x8002000A (DISP_E_OVERFLOW)) Failed to execute (OSMGPDownload). Failed at Mon Jun 18 11:28:48 2018 (Elapsed Time: 4,53 seconds)

ThomasEmge commented 6 years ago

Your target feature dataset "D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb_5 " is not valid. You'll need to name it conforming to the geodatabase rules, maybe something like "D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb\m5" by changing `ds = 'm' + str(row[1])`

acanivano commented 6 years ago

I changed what @ThomasEmge said to me but I obtain the same result.

Messages Executing: OSMGPDownload http://www.openstreetmap.org "291739,210780744 9164768,91156832 296739,210780744 9169768,91156832" DO_NOT_INCLUDE_REFERENCES D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb\m_5 D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb\m_5m_5_osm_pt D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb\m_5m_5_osm_ln D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb\m_5m_5_osm_ply Start Time: Tue Jun 19 11:53:48 2018 Debugging... Starting OSM Data download request... Counting elements in OSM file... Counted 0 nodes, 0 ways, and 0 relations. General error in the node loading routine (Fuera del intervalo actual. (Exception from HRESULT: 0x8002000A (DISP_E_OVERFLOW))). Executing: RepairGeometry D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb\m_5\m_5_osm_ln DELETE_NULL Start Time: Tue Jun 19 11:53:53 2018 Succeeded at Tue Jun 19 11:53:53 2018 (Elapsed Time: 0,01 seconds) Executing: RepairGeometry D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb\m_5\m_5_osm_ply DELETE_NULL Start Time: Tue Jun 19 11:53:53 2018 Succeeded at Tue Jun 19 11:53:53 2018 (Elapsed Time: 0,01 seconds) Updating remaining references... Fuera del intervalo actual. (Exception from HRESULT: 0x8002000A (DISP_E_OVERFLOW)) Failed to execute (OSMGPDownload). Failed at Tue Jun 19 11:53:54 2018 (Elapsed Time: 5,77 seconds

)

ThomasEmge commented 6 years ago

A few more changes are required. The new code should like this

import arcpy
from arcpy import env

# load the OpenStreetMap specific toolbox
arcpy.ImportToolbox(r'c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Toolboxes\OpenStreetMap Toolbox.tbx')

cuadricula = r"D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb\grid_peru"
gdb_destino =  r"D:\PROYECTOS\LATAM_mio\PERU\OSM_Peru.gdb"
try:
    with arcpy.da.SearchCursor(cuadricula,["SHAPE@","id_grid3"])as cursor:
        for row in cursor:
            ds = 'm_' + str(row[1])
            datset_name = arcpy.os.path.join(gdb_destino, ds)
            pt_featureclass = arcpy.os.path.join(datset_name, ds + "_osm_pt")
            ln_featureclass = arcpy.os.path.join(datset_name, ds + "_osm_ln")
            ply_featureclass = arcpy.os.path.join(datset_name, ds + "_osm_ply")
            extent = row[0].extent

            arcpy.OSMGPDownload_osmtools('http://www.openstreetmap.org', extent, 'DO_NOT_INCLUDE_REFERENCES', 
            datset_name, pt_featureclass, ln_featureclass, ply_featureclass)
except (RuntimeError, TypeError, NameError):
    pass

print ("Script OK")
acanivano commented 6 years ago

Thanks for the changes @ThomasEmge , but the script still not working.

ThomasEmge commented 6 years ago

What is your current error message?

acanivano commented 6 years ago

I´m using a vector grid which divides Peru in equal squares (minimum area in which I know there are OSM information). The script iterates for every square downloading the information until it doesn´t find information and it gives back the error:

General error in the node loading routine (Exception from HRESULT: 0x8002000A (DISP_E_OVERFLOW)).