Skip to Content.

mget-help - RE: [mget-help] Error in create fishnet tool

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


RE: [mget-help] Error in create fishnet tool


Chronological Thread 
  • From: Jason Roberts <>
  • To: Rodrigo Tardin <>
  • Cc: "" <>
  • Subject: RE: [mget-help] Error in create fishnet tool
  • Date: Sun, 18 Aug 2019 13:17:51 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=duke.edu; dmarc=pass action=none header.from=duke.edu; dkim=pass header.d=duke.edu; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a90RGncM5pKNPzd6Gk8q74xBfdJQYKIXMNcIREg6H+4=; b=lykJm13pK9AXSaQqroiM3gSMHbJzgKdwhSgkSolf9ISH0lURhG/l68TbTSag0EFXF2C/nEuWnabkuMY29TE2iHQH8WOJLzcZ3bEzm4vIKF+FqpGU177I9CnEXXBbiltsuYs+DZoNAZyY0qURonmMD5Wd+/axg7MMld4balguEnFbTaeuRo7wdo4uf0vhovG3iwnXPxzG7v2pNWzDvV6x+Wdgp9AQRdo6tST7glxRQ9yaQHbZvL2y4s3Bzx8zFbHPMr6leCg7g++s+fqMN7TiDTZZ2qUsLj72daw5vI+9u7TCqZO7Z9xzZ2cjuhHE8ZBClxHctOqjzOlZ53nDdY8dNg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lcIUfsazMjrhvTf7hBOh0g02pV3Cevu6dnpGx789Gr05lpz8XNXShGgeVtgWn1LSTZ36HpZEsCoDZRVzDhs1LbN/FMPufyfyZFtCabsTnkDKEy3rCjlDmB3yrKovkBr5E38PlXWjtkvIWN2/T+bp/0z5MlSMqFwtfiLTYuU6jII1XVGES+IqOt9Z7BMWl6hT38/7eMG/F5Qdmjbw6sG4ElNNLc+4E0QI6BOlcmBMtnoUJa3MfO4f9cfAiNmTHFj3HGc1K4FyLU1uPXdmGYfDuWIDr5VeWw7EaxUbsC+CYl+k3fwLXIcHw+LQSFYBhwgLQ87I4ccXqSJRKeE+RccHLQ==

Dear Rodrigo,

 

Sorry for my slow reply. I am on vacation until 26 August. I can offer more help starting that week.

 

My initial thought is that this looks like a bug. The tool is supposed to calculate the cell area and populate the CellArea field. The error message indicates that the tool is trying to store null for the area. Shapefiles cannot store null for a numeric field, so this fails. My question is: why is it storing null? Without looking at the code (which I cannot do at this moment), I’d assume it would always be able to calculate a value. So this seems like a bug. In any case, you might be able to work around it by storing the fishnet in a geodatabase instead. Geodatabases allow null for numeric fields, and depending on how the tool is written (which I cannot recall), it might complete successfully with null in that field. If it does, you can then just export the feature class to a shapefile.

 

Alternatively, you could try deleting the text “CellArea” from that optional tool parameter. This should cause the tool to not write a CellArea field at all. But again, without looking at the code, I can’t say for sure whether this would work.

 

Let me know how these suggestions go. If you’re still stuck I can look at this in detail the week of 26 August.

 

Best,

Jason

 

From: <> On Behalf Of Rodrigo Tardin
Sent: Wednesday, August 14, 2019 11:25 AM
To:
Subject: [mget-help] Error in create fishnet tool

 

Dear Jason,

 

I am not new in MGET and have worked a reasonable amount of time on some tools. I've been having a problem in the create fishnet tool that I have never had before. Hope you can help me.

 

When I input all the parameters in the appropriated boxes (x and y coordinate of the fishnet corner (SIRGAS 2000 datum), cell width and height (0.009), number of columns and rows (40), etc), I got the following error:

 

Executing: ArcGISFishnetsCreateFishnet "C:\Users\rhtar\ArcGIS\toc.shp" "GEOGCS['GCS_SIRGAS_2000',DATUM['D_SIRGAS_2000',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision" -49.606 -2.301 "Lower Left" 0.009 0.009 40 40 # Fail # # # # # CellID CellCol CellRow CellArea # 0 0 0
Start Time: Wed Aug 14 12:15:29 2019
Running script ArcGISFishnetsCreateFishnet...
Inserting 1600 fishnet cells.
RuntimeError: This cell cannot be inserted into ArcGIS ShapeFile "C:\Temp\GeoEcoTemp_rhtar\tmppimxui\Fishnet.shp" because field CellArea has not been assigned a value and it is not nullable. You must provide a value for this field.
Failed script ArcGISFishnetsCreateFishnet...

Traceback (most recent call last):
  File "C:\Program Files\GeoEco\ArcGISToolbox\Scripts\ArcGISFishnetsCreateFishnet.py", line 5, in <module>
    ExecuteMethodFromCommandLineAsArcGISTool('GeoEco.SpatialAnalysis.Fishnets', 'ArcGISFishnets', 'CreateFishnet')
  File "C:\Python27\ArcGIS10.6\lib\site-packages\GeoEco\ArcGISScripts.py", line 210, in ExecuteMethodFromCommandLineAsArcGISTool
    exec sourceCode in globals(), locals()
  File "<string>", line 1, in <module>
  File "C:\Python27\ArcGIS10.6\lib\site-packages\GeoEco\SpatialAnalysis\Fishnets.py", line 354, in CreateFishnet
    cur.InsertRow()
  File "C:\Python27\ArcGIS10.6\lib\site-packages\GeoEco\Datasets\__init__.py", line 2535, in InsertRow
    raise RuntimeError(_(u'This %(singular)s cannot be inserted into %(dn)s because field %(field)s has not been assigned a value and it is not nullable. You must provide a value for this field.') % {u'singular': self._RowDescriptionSingular, u'dn': self._Table.DisplayName, u'field': f.Name})
RuntimeError: This cell cannot be inserted into ArcGIS ShapeFile "C:\Temp\GeoEcoTemp_rhtar\tmppimxui\Fishnet.shp" because field CellArea has not been assigned a value and it is not nullable. You must provide a value for this field.

From what I understood, the error seems to be in the field 'CellArea', which is an optional field to inform the name of the field (not a number - I have tried to put any number with no success). In all previous analyses that I created fishnets, I never filled this field. I can't figure out what is wrong. I tried to change the datum and other values but I still got the same error. 

 

Do you have any thoughts on what happened?

Thank you in advance,

 

Rodrigo

 

Rodrigo Tardin

Pós-doutorando - Departamento de Ecologia - IB - UFRJ

Pesquisador Associado - Laboratório de Bioacústica e Ecologia de Cetáceos

D.Sc. em Ecologia e Evolução - IBRAG - UERJ

-----

Post-doctoral fellow - Ecology department - IB - UFRJ (RJ, Brazil)

D.Sc. in Ecology and Evolution - UERJ

Associate scientist at Cetacean Bioacoustics and Ecology Lab 

 




Archive powered by MHonArc 2.6.19.

Top of Page