Skip to main content
Solved

Exported shapefile problems - FeatureWriter

  • June 16, 2020
  • 17 replies
  • 92 views

Hi,

So after lots of testing, it's looks like when I export shapefiles using the FeatureWriter and include the .sbn Spatial Index, the shapefiles do not function properly. When first loading them in ArcMap, they appear to be ok, but when zooming, selecting, panning the map, I get very odd results with certain features suddenly dissapearing, not being selectable, etc.

 

If I modify my FeatureWriter to not include any spatial index, then the shapefiles work fine. I only have this problem when I include the spatial index.

 

I would like to include the spatial index. Is there a fix for this??

 

Thanks,

Best answer by debbiatsafe

This issue has been fixed in 2020.2 betas. Shapefiles with a .sbn spatial index should display correctly in ArcMap at various zoom levels.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

17 replies

jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • June 16, 2020

I do know the opposite problem, shapefiles with spatial indexes were not being read correctly when a bounding box or search envelope was used, was fixed in the 2020.0.3 release.


  • Author
  • 16 replies
  • June 16, 2020

I do know the opposite problem, shapefiles with spatial indexes were not being read correctly when a bounding box or search envelope was used, was fixed in the 2020.0.3 release.

Hi @jdh,

I can confirm that I am using 2020.0.3, and when I 'draw a box' around features in the shapefile they DO NOT get selected properly.

Also when zooming in, features randomly dissapear.

 


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • June 16, 2020

Hi @jdh,

I can confirm that I am using 2020.0.3, and when I 'draw a box' around features in the shapefile they DO NOT get selected properly.

Also when zooming in, features randomly dissapear.

 

That absolutely sounds like a corrupt spatial index. I suggest you file a bug report with SAFE. I would give them your workspace, and two samples outputs, one with the spatial indexes created in FME, and one where they are created in arcmap (ie no index of the featureWriter, but use the Add Spatial Index tool in arcmap).


  • Author
  • 16 replies
  • June 16, 2020

That absolutely sounds like a corrupt spatial index. I suggest you file a bug report with SAFE. I would give them your workspace, and two samples outputs, one with the spatial indexes created in FME, and one where they are created in arcmap (ie no index of the featureWriter, but use the Add Spatial Index tool in arcmap).

Thanks @jdh,

Where do I go to open a bug report?

Also, in the meantime what can be done. Is there an alternative to creating shapefiles, other than the FeatureWriter? I thought using FME to replace a process already created in esri Model Builder would be a good idea, but I've spent so much time on trying to resolve glichy little things I'm losing confidence that this was the right decision.

 


Forum|alt.badge.img+2
  • 1891 replies
  • June 16, 2020

Thanks @jdh,

Where do I go to open a bug report?

Also, in the meantime what can be done. Is there an alternative to creating shapefiles, other than the FeatureWriter? I thought using FME to replace a process already created in esri Model Builder would be a good idea, but I've spent so much time on trying to resolve glichy little things I'm losing confidence that this was the right decision.

 

@bbulla you can file an issue at through https://www.safe.com/support/report-a-problem/


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • June 16, 2020

Thanks @jdh,

Where do I go to open a bug report?

Also, in the meantime what can be done. Is there an alternative to creating shapefiles, other than the FeatureWriter? I thought using FME to replace a process already created in esri Model Builder would be a good idea, but I've spent so much time on trying to resolve glichy little things I'm losing confidence that this was the right decision.

 

To report a bug you can fill out the following form https://www.safe.com/support/report-a-problem/

 

As for your current process, How important is is to have a spatial index? Ie how much time savings are you seeing further down the process. Everything will work without one.

If they are vital, until the bug gets fixed, you could potentially use python to run the arcmap tool.


  • Author
  • 16 replies
  • June 16, 2020

To report a bug you can fill out the following form https://www.safe.com/support/report-a-problem/

 

As for your current process, How important is is to have a spatial index? Ie how much time savings are you seeing further down the process. Everything will work without one.

If they are vital, until the bug gets fixed, you could potentially use python to run the arcmap tool.

Yes, I could get by without using the index file. Unfortunately in our current process, the tablets that these shapefiles will eventually go on, get put onto them through a copy/paste process. So if I do not have new spatial index files, then the existing index files will get mixed it with the new shapefiles and that will cause big problems.

Also, there are more than just shapefiles in the folder that these shapefiles will go to, so to make sure to remember to go though all the files and delete only the existing spatial index files is not really that practical. If we even miss one file in this step on one of the 80+ field tablets, it will cause lots of grief.

The best solution is to just have the spatial index files work properly to facilitate an easy, no brainer, copy/paste process that is already existing.

 

 


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • June 16, 2020

Yes, I could get by without using the index file. Unfortunately in our current process, the tablets that these shapefiles will eventually go on, get put onto them through a copy/paste process. So if I do not have new spatial index files, then the existing index files will get mixed it with the new shapefiles and that will cause big problems.

Also, there are more than just shapefiles in the folder that these shapefiles will go to, so to make sure to remember to go though all the files and delete only the existing spatial index files is not really that practical. If we even miss one file in this step on one of the 80+ field tablets, it will cause lots of grief.

The best solution is to just have the spatial index files work properly to facilitate an easy, no brainer, copy/paste process that is already existing.

 

 

In which case I suggest, that until the bug is resolved, use a shutdown script to call arcpy and generate the spatial indexes as a post process.


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • June 16, 2020

In which case I suggest, that until the bug is resolved, use a shutdown script to call arcpy and generate the spatial indexes as a post process.


  • Author
  • 16 replies
  • June 16, 2020

In which case I suggest, that until the bug is resolved, use a shutdown script to call arcpy and generate the spatial indexes as a post process.

Thanks @jdh,

I'll have to investigate. I'm not well schooled in python. Can you point me to some online samples on how to do this??


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • June 16, 2020

Thanks @jdh,

I'll have to investigate. I'm not well schooled in python. Can you point me to some online samples on how to do this??

There's some example code at https://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/add-spatial-index.htm

I've never used that particular tool, but presumably your in features would be the shapefile, you don't need the sde connection, and the spatial grid should be 0.

 

 

In FME make sure the python compatibility is set to ArcGIS Desktop or ArcGIS Pro, as appropriate.

  • Author
  • 16 replies
  • June 16, 2020

There's some example code at https://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/add-spatial-index.htm

I've never used that particular tool, but presumably your in features would be the shapefile, you don't need the sde connection, and the spatial grid should be 0.

 

 

In FME make sure the python compatibility is set to ArcGIS Desktop or ArcGIS Pro, as appropriate.

Awesome! Thanks @jdh. That was super easy!

Do you know if there is a way to incorporate the User Parameter I have for the folder into the python code?? This parameter gets set when the workflow starts. That way I can get out of hard coding it and having to constantly change it.


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • June 16, 2020

Awesome! Thanks @jdh. That was super easy!

Do you know if there is a way to incorporate the User Parameter I have for the folder into the python code?? This parameter gets set when the workflow starts. That way I can get out of hard coding it and having to constantly change it.

You can access user parameters via the fme.macroValues dictionary.

https://knowledge.safe.com/articles/706/python-and-fme-basics.html


  • Author
  • 16 replies
  • June 16, 2020

You can access user parameters via the fme.macroValues dictionary.

https://knowledge.safe.com/articles/706/python-and-fme-basics.html

Great. Thanks for all your help @jdh. Things are working well now.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • July 6, 2020

Did this get raised as an issue?


  • Author
  • 16 replies
  • July 7, 2020

Did this get raised as an issue?

Yes, FME knows it is an issue. They contacted me and were able to replicate the problem. For now, the shutdown script seems to be the best workaround.


debbiatsafe
Safer
Forum|alt.badge.img+21
  • Safer
  • 648 replies
  • Best Answer
  • August 7, 2020

This issue has been fixed in 2020.2 betas. Shapefiles with a .sbn spatial index should display correctly in ArcMap at various zoom levels.