This app is a demonstration of searching and loading basemaps from xyzservices and Quick Map Services (QMS). Selecting from 1000+ basemaps with a few clicks.
https://share.streamlit.io/giswqs/streamlit-geospatial/app.py?page=Search+Basemaps
This app is a demonstration of searching and loading basemaps from xyzservices and Quick Map Services (QMS). Selecting from 1000+ basemaps with a few clicks.
https://share.streamlit.io/giswqs/streamlit-geospatial/app.py?page=Search+Basemaps
Such a great app , thank you for sharing .
Best
Avra
great app for reference. Thanks Mr. Wu
@giswqs
Hi, I found when I tried to import kml file, asia area kml file is not supported to show on the map but America and Africa area kml files are able to show.
In addition, how to set the middle coordinate to let map window range can move to the kml area.
Can you figured out why and how to solve these problem, thank you.
Here is code I copied from your app
import os
import geopandas as gpd
import streamlit as st
import leafmap.foliumap as leafmap
data = st.file_uploader("Upload a vector dataset", type=["geojson", "kml", "zip"])
def save_uploaded_file(file_content, file_name):
"""
Save the uploaded file to a temporary directory
"""
import tempfile
import os
import uuid
_, file_extension = os.path.splitext(file_name)
file_id = str(uuid.uuid4())
file_path = os.path.join(tempfile.gettempdir(), f"{file_id}{file_extension}")
with open(file_path, "wb") as file:
file.write(file_content.getbuffer())
return file_path
if data is not None:
width = 800
height = 600
file_path = save_uploaded_file(data, data.name)
layer_name = os.path.splitext(data.name)[0]
m = leafmap.Map(draw_export=True)
m.add_vector(file_path, layer_name=layer_name)
m.to_streamlit(width, height)[正在处理:africa.kml…]()
I used the polygon draw function to generate kml file in google earth.
I have updated the app. The map can now zoom to the center of the uploaded datasets automatically. KML files of Asian regions work fine on my end.
thank you so much, now we can see the kml in asia area.
Have you try to read and add mapinfo file format like TAB to the online map?
And if we draw a new polygon, can we export it as a kml file and open it in google earth?
GeoPanas should be able to read MapInfo Tab file. I have added “Tab” format to the upload app. Try it out. To draw and export polygons, you need to use the folium plotting backend. See this demo.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.