-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Displaying Vector Data #150
Comments
@DavidLeifer There are some integration test notebooks which you can check. |
@dorukozturk does that mean you could pass a pandas data frame of x,y coordinates in? Like instead of: Do this: |
I don't think directly passing in a dataframe will work. The API expects an iterable object containing two numbers. I'm not an expert in pandas, but I'm sure there is some way to get that from a dataframe. Also, each point will need to be added individually as there is no "bulk" operation for generation annotations. |
So I've saved the pandas dataframe as a geojson. This notebook gives reference as to add geojson rectangles onto a map. I think this should work for point data as well right? When I try to add it to the map as a layer I get: AttributeError: 'dict' object has no attribute 'name' |
How are you trying to add the geojson data? There is a difference between a vector data layer and an annotation which may be causing confusion here. As I recall, the vector data needs to load from a file of some sort (anything that fiona supports) and has to be represented in EPSG:4326 (latitude/longitude). The only way to add annotations programatically is through the a call like |
I've converted my pandas data frame of column 'x' and column 'y' coordinates into a geojson file using this. So I have a geojson file saved in the geojson variable. The vector data layer should be able to add the points with the following line, correct? v = VectorData(geojson) That would be disappointing if you had to add each individual point using annotations. I guess I'm trying to add the points programatically. |
The |
I've created a geojson file. |
@DavidLeifer We did a bug fix on not displaying layers. Can you pull the latest version and try? |
@dorukozturk yeah thanks I'll check it out. |
That did not work for me, still having the same issue. |
This isn't really an issue, but how would I display a series of X,Y coordinates of points? Would it be possible to add a pop up window to the display?
The docs go into depth about displaying raster data but don't really cover vector data:
`from geonotebook.wrappers import RasterData
rd = RasterData('file:///path/to/file.tiff')
M.add_layer(rd[1, 2, 3], opacity=1.0, gamma=2.5)
`
The text was updated successfully, but these errors were encountered: