Hot answers tagged

4

The CascadingStyle tag isn't supported, but this works <Style id="__managed_style_25EBAAC82614827EFCCB"> <IconStyle> <scale>1.2</scale> <Icon> <href>https://earth.google.com/earth/rpc/cc/icon?color=1976d2&amp;id=2000&amp;scale=4</href> </...


3

Your first error may be from using the vertex tool (all vectors) - it may have tried to modify an underlying layer that you did not intend to edit (for example world_map.gpkg in your error message). Your second issue is due to the fact that you cannot perform most edits on KML/KMZ files in QGIS. Even though you can see the yellow pencil enabled which ...


3

No, not if you use Google Maps and KML as it requires the client to download the data so it is already on the client machine. If you need to maintain physical control on your data then you need to look at using (an open standard) WMS service to serve up images of your data.


2

You are trying to specify two output drivers, KML and LIBKML. Don't. Just specify LIBKML. Make sure your OGR_STYLE field has the literal text: BRUSH(fc:#0000FF);PEN(c:#000000) Not OGR_STYLE: BRUSH(fc:#0000FF);PEN(c:#000000) So your command would look like: ogr2ogr -f libkml output.kml input.shp Which results in the below for my test data: <?xml version=...


2

QGIS styling is not directly exported in KML. You can, however, construct a style string in a special attribute called OGR_STYLE for each feature, and that will be interpreted if you export with the libkml driver. More details at Styling KML through LIBKML layer creation options


2

The splitext splits the path into the root and the extension (https://docs.python.org/3/library/os.path.html#os.path.splitext). So the return value is a tuple. You probably want to choose the root. Therefore, you need to change the line in your code as follows outKML = os.path.join(os.path.splitext(layer)[0], ".kmz")


2

You can do full Transactional Editing of Data (WFS-T) you can output to multiple formats Check out the newer OGC API Features specification (it will basically become WFS 3.0 but it's using JSON instead of XML and has nicer interface and pages) Crunchy Data offers pg_featureserv or GeoServer has a Community Module/Extension Check out GeoJSON-VT for leaflet ...


2

Try using os.walk: import os root_folder = r'/home/bera/Downloads' #Change to match your main folder for root,folders,files in os.walk(root_folder): for file in files: if file.endswith('.kml'): vl = QgsVectorLayer(os.path.join(root,file), os.path.splitext(file)[0]) #Create vector layer QgsProject.instance().addMapLayer(vl)...


2

It needs to be a list: name = "NAME" datasource_options = [] datasource_options += ["DescriptionField=" + name] datasource_options += ["NameField=" + name] QgsVectorFileWriter.writeAsVectorFormat(layer, output_layer, "utf-8",layer.crs(),"KML",datasourceOptions = datasource_options)


2

So, finally I came up with the following solution as the OL Parser does not support cascadingStyle Tag: function removeBadTags (rawSource) { let result = rawSource; // remove "cascadingStyle" Tags result = rawSource.replace(/<.*?cascadingstyle.*?kml:id="(.+)">\s*<style>/gmi, (a, b) => { return "<...


1

As Mike stated in the comments Even when you have a cluster of one you will need to extract the real feature from the cluster this means the return feature; will need to instead be return feature.get('features')[0]; so the code became Omap.on('click', function (evt){ var feature = Omap.forEachFeatureAtPixel(evt.pixel, function (feature,layer) { ...


1

I finally found the solution: I imported my KML file to Excel opening it as a XML Table type file (the import made Excel load for a long time, but didn't crash). Then I could extract latitude and longitude data. I put them in a blank KML file that I created with Google Earth so this file was correctly formatted. Then I edited the "description" ...


1

please try to follow following steps, give the CRS as WGS 84 (Google earth prefer this CRS) within Select fields to export and their export options please tick the only attributes you require, i.e. remove the unwanted attributes with in Geometry please select polygon from the drop down then try to export the file.


1

Sounds like what you're looking for is a KML NetworkLink with a view-based refresh, and a serverside script that gets the view parameters from the NetworkLink request, and sends back new KML content based on the user's view. In a bit more detail, you probably want a <NetworkLink> tag, whose <Link> tag uses a view-based refresh via the tags: <...


1

Looks like you're using a Coordinate Reference System (CRS / projection) of EPSG:27700. When working with or converting to KML, you should always use the basic, EPSG:4326. That's the only projection supported by Not sure if that's what's causing this error, but certainly something to check.


1

I presume you are using ArcGIS Desktop from the screenshot and the tool name. As far as I know, the title of the popup is controlled from Display tab of the Layer properties. By default it is the first string field in your table. The style of the table is controlled by the HTML Popup tab of the Layer Properties again. In your snip, this is the default HTML ...


1

Styling is QGIS-specific and thus you can't just export it and see it in the same shape, color, size etc. in any other application (or only if it has a rendering that matches the one that is implemented in QGIS). Style is not standardized, but program-specific. The yellow markers of Goolge Earth will not be shown the same way in QGIS either (if you do the ...


1

Finally, I fixed the issue inspired by the following answer https://gis.stackexchange.com/a/328554/133557, I changed the driver to 'LIBKML', so the final code as following: import fiona import pandas as pd import geopandas as gpd gpd.io.file.fiona.drvsupport.supported_drivers['LIBKML'] = 'rw' fp = 'Sentinel-1A_MP_20201006T160000_20201026T180000.kml' ...


1

There is no proper error handling in leaflet-kmz plugin. To correct this it would require modification of plugin code on several places. Quick and dirty trick to make plugin work as you want requires only adding one line in the loadFile function at the beginning of leaflet-kmz-src.js: function loadFile(url) { return new Promise((resolve, reject) => { ...


1

The Plugin "KML Tools" (author C Hamilton) from the official QGIS repository helped me open the KML file with MultiGeometry content.


1

Create a field named "Name", than your exported kml-file will show it as the name of the point and as label on the map besides the pin. Copy the values from the unique-id-field to the Name field, using the field calculator, which you can also use to create the field "Name":


1

I experienced this problem just now and came up on this answer. I noticed the error message had pyKML with capitalized letters. It will work if you use all lowercase letters.


1

The above question is specific to Placemarks being Points. However, there are a number of other geometries available such as LineStrings, Polygons and more. To know how to extract coordinates from all types of geometries, you can check out this article: https://medium.com/@wwaryan/the-definite-only-guide-to-fastkml-58b8e19b8454 Also, for the other answer, ...


1

In fastkml, the process that I have found is this : Read KML File Parse Placemarks from the file Parse Geometries (if any) inside the Placemarks If LineString, extract coordinates Since you didn't mention where exactly you get stuck on in this process, I think this article can help you out throughout the process : https://medium.com/@wwaryan/the-definite-...


Only top voted, non community-wiki answers of a minimum length are eligible