Issues in importing vector data

While importing .shp file (which was created in ArcGIS ) in SNAP ,it shows the error “the vector data was loaded successfully but no part was located within the scene boundaries”.I want to know why this error occurs .Can anyone help me?

Actually, the message says it already. The shapes stored in the shapefile do not overlap with the scene you currently work with. Maybe you have a global scene available. Then you can check where they are located. Maybe something went wrong when creating the file with ArcGIS. Have you reimported them?

Actually I have created shape file using google earthview (.kmz) and exported as shape file in ArcGIS(.shp file) and tried to import the shape file in SNAP.I have did this more than once but I got the same error same time.What I have to do?

Check the coordinate boundaries of the shapefile if they are in the same reference system as your raster. If one is UTM and the other is WGS84, for example, you could get problems.

1 Like

This seems to be a tricky problem. What I have observed so far is that for some polygons are invalid after converting from kml to shapefile.
I’ve used the lake michigan as an example. I draw a polygon around it.
Accidentally I created a border which crossed its self. See left side of the image:


I’ve converted the exported kmz with QGIS to a shapefile. This didn’t work in SNAP. By debugging through the code, I saw that there is an exception which means that the geometry is not valid.
Then I validated the shapefile in QGIS and it says it contains invalid geometries but it is displayed correctly.
Then I created a new boundary of the lake. Now without overlaps.

This geometry could be imported well into snap after the conversion to a shapefile.

I couldn’t yet figure out why the geometry becomes invalid. @rani maybe you have a similar problem and you can fix it by drawing the boundary again.

1 Like

Thank you Mr.Marpet , I too observed the same geometry issue , so again I drawn the polygon and tried to import it in SNAP .But I got the same error .Are you doing any projection conversions while creating a shape file?

No, I’m doing nothing special. Just importing the KMZ and exporting to shapefile in QGIS.
But my product I want to import the vector data into was WGS84.
Now I tried a Landsat scene which is UTM. And I was able to import the data too.

Can you give me your shapefile? You can send it in a PM, if you don’t want to attach it publicly.

I am having exactly the same issues. I have now tried to export my shapes from QGIS as CSV instead. I confirm there are no mistakes in the file. Unfortunately it seems even as CSV SNAP is expecting a very specific format of columns as it isn’t recognising the clear lat lon columns (I have one column for each).
The error I get for the CSV import is “java.io.IOException: Neither lat/lon nor geometry column provided.”
This suggests it is expecting a single column? Maybe? How do we discover this?

I have a new question:
In previous versions of SNAP, when a shapefile was imported, a dialogue was opened which asked if column in the attributes defines a class variable. This allowed to split the imported geometries into several distinct vector containers, for example, as input classes for supervised classification. I tried several shapefiles with different colums (names or numbers) but this dialogue doesn’t come up anymore.

Was this dialogue removed on purpose? I found it quite helpful because it allowed to have the shapefile split after the import. The current work-around is to import one shapefile per class which is some more steps to prepare.

Edit: I found an old screenshot of it
grafik

Hi Andreas,

The dialog is still there and it should work as before.


I’ve used the attached shapefile. countries.shp (1.5 MB)

Maybe you can provide one of the shapefiles you have tried?

There are some examples in the Help on the CSV File Conventions page. The page is linked from the Import Vector Data / CSV page

thank you, Marco. You are actually right. Your shapefile works fine for me.
It happened when I used vector points: points_75m_training.zip (121.1 KB)

Yes, for points it is not working. Maybe you can convert your points into polygons. I’ve tried with QGIS but it did not work. But I’m not an expert in this GIS domain.
I take your use case and put it on our issue list. (SNAP-965)
Grouping shapes (also points) by a specified attribute. Sounds very reasonable.

1 Like

thank you - as long as I know a work-around, it’s fine to me.
I just thought the whole function was gone.

Hey!

I chose UTM / WGS 84 (Automatic) for my Landsat image and used WGS 1984 for my shapefiles created in ArcGIS. I had the same problem as rani when I wanted to import them in SNAP, so I tried everything I know to make them have the same spatial reference.

  • I imported the satellite image in Arc GIS and checked its spatial reference, which was WGS_1984_UTM_Zone_36N. Then I created a new feature class and chose the same as the satellite image, but that didn’t work
  • I tried the tool Project
  • I tried the tool Define Projection
  • I tried Create new feature class and Existing Feature
  • I imported a shapefile which did work in SNAP (it was WGS 1984) and chose the same for the shapefiles, didn’t work either

I don’t know why it doesn’t work when it did work before. I think I thought myself too much into this, so I can’t see the problem anymore.

I would appreciate help a lot!!

this is very likely a matter of WGS84 (geographic coordinates in latitude and longitude) vs. UTM (metric coordinates)

You can check the coordinate extent of the datasets in the properties. If both raster and vector data are stored in UTM the coordinates should have at least 6 digits

Dear all,
I’m trying to import a shapefile into Snap but there seems to be a problem with crs (the vector data was loaded successfully but no part was located within the scene boundaries).
I can’t understand why as I checked that the raster and shapefile have the same crs.
Any suggestions?

I attached the shapefile and raster.
Thank you very much!

cop17_class1.shp (1.4 MB) cop17_ready.tif (4.0 MB)

a Shapefile consists of multiple files, please share all of them (not just the .shp)

Yes, sorry I forgot it. Thanks.
class1.zip (259.5 KB)

thank you. I can confirm that both datasets are referenced in UTM 33N and can be overlayed in QGIS, but upon import into SNAP there is no dialogue asking for the coordinate reference system of the vectors (probably WGS84 is assumed) which leads to the mentioned error message that the datasets do not cover the same extent

@marpet is there a way to tell SNAP that the vectors are stored in UTM?