2

I tried to perform a 1-to-many spatial join between polygons (target feature) and lines (join features) to join the lines that are completely covered by a polygon to that polygon. (the polygon is actually a result of buffering the lines with a dissolve option) I used the option 'completely contains', but this returned a background processing error. After sending parts of my data to Esri Inc, I got the confirmation that there is indeed a bug they need to fix (#NIM086228).

Anyway, my project needs to be completed. In search of a work-around, I already tried to turn the lines into polygones (small buffer around it), but it returns the same error. When trying the contains_clementini (or actually all contains and within options) suddenly give me an error even before running it. The error is 'Relationship invalid for selected layers'.

Here is what I need to do:

I have (pipe)lines that I want to 'merge' when they have common characteristics. So I create a buffer and let it dissolve when the value of those characteristics is equal. A polygon layer is created, but there is not link back to the underlying lines that are the basis of the polygon. In order to have these ID's, I wanted to perform the spatial join with match option 'completely contains

Has someone any experience with the last type of invalid error messages or another workaround for me?

  • 2
    An image of what you are trying to achieve would help us understand your situation better. Secondly, do you have to do this only in ArcGIS desktop? Would a solution in say PostGIS be acceptable to you? – Devdatta Tengshe Apr 8 '14 at 8:11
  • Are you able to edit your Question to include the Esri bug number, please? It should start with "NIM" unless they have changed it. What was the background processing error that you received? – PolyGeo Apr 8 '14 at 8:25
  • I edited the question and updated it with the #NIM number. I don't succeed in recreating the error, since apparently now all my spatial joins are accompanied with the second described error message of invalid feature types :s. – Mieke Apr 8 '14 at 13:40
  • I am not familiar with PostGIS... If it is a solution and I don't need to buy an extra license, I am happy to try out of course. – Mieke Apr 8 '14 at 13:42
  • I can't add an image, but it boils down to the following:I have (pipe)lines that I want to 'merge' when they have common characteristics. So I create a buffer and let it dissolve when the value of those characteristics is equal. A polygon layer is created, but there is not link back to the underlying lines that are the basis of the polygon. In order to have these ID's, I wanted to perform the spatial join with match option 'completely contains'... – Mieke Apr 8 '14 at 13:43
1

According to my understanding, you want to get the id from some Polygon, into the buffer features which are contained within the given polygon.

These kind of spatial operations and queries are quite easy to do in a spatial Database like PostGIS or even SpatiaLite. You just need to be handy with SQL.

I'll suggest that you export your data to shapefiles. Using the Spatialite-GUI, you can load them into a spatialite database, and then do spatial queries on them.

Suppose you have two polygon features like this: enter image description here

Here the Blue Polygons are your Boundry Polygons, and Pink are the buffered polygons. Each has a field called f_code (I'm just using this as an example, since we need to use it in the update query below; You will have to change the field names in the update query to match your data)

I would follow these steps:

  1. Export the two polygon featureclasses to Shapefile

  2. Open Spatialite-gui

  3. Create a new empty sqlite Database enter image description here

  4. Load both the shapefiles into this Spatialite Database, while ensuring that you set the SRID properly. enter image description here

  5. Once the two shapefiles are loaded, you can run an update command like this:

    Update buff set f_code=( select f_code from bnd where ST_Contains(bnd.Geometry, buff.Geometry) )

    In this case, buff is the buffer polygon (pink in the above image) & bnd is the Boundry polygon (blue in the above image)

    Your buffer polygons will now have the ids of the Boundry polygon

  6. To get the data back in ArcGIS you have multiple options. Since you have ArcGIS 10.2, you should be able to connect and use Spatialite databases directly. In case you can't, you could export the attributes of the buff table to dbf, and join it in ArcGIS to the shapefile, and copy data over.

  • Hi, I wanted to test this solution, but got stuck at installing Spatialite-gui :s. I downloaded and unzipped the files at the hyperlink in the answer, but did not find an executable file to start installation. Sorry for these extra questions. In meanwhile I'll save my gdb-files as shapefiles :). – Mieke Apr 14 '14 at 11:19
  • @Mieke: See if you can download and use this: gaia-gis.it/gaia-sins/windows-bin-x86/… – Devdatta Tengshe Apr 14 '14 at 11:33
  • Thank you, I could save this and I have the first screen. However, if I want to create a new DB and I have to save this in the first step, the program hangs. I have to add that this hurdle is annoying me for 2 days, not only in this program, but each time if I need to save something (primarily in Excel), so chances are high that it is not related to this program. I am in vacation for a few days now, so I will go to the help desk with this saving error next week Tuesday and will then come back to you. Sorry for all the delays.. – Mieke Apr 15 '14 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.