Is it possible to write a python code for convert shape file to kml? Please give me the advice and way to do.Thank you

4456
20
05-15-2018 08:17 PM
kanchanarajapaksha
New Contributor

Is it possible to write a python code for convert shape file to kml? Please give me the advice and way to do.Thank you

0 Kudos
20 Replies
DanPatterson_Retired
MVP Esteemed Contributor

There are existing tools in arcmap and ArcGIS Pro

KML conversion tools, Layer to KML

Sample code exists on geonet

https://community.esri.com/thread/167881

kanchanarajapaksha
New Contributor

Dear Sir,

Actually, I want to run a python program independently. But it says a error

'No module named arcgisscripting'

Let me know to fix it.

Regards,

Kanchana

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

You have to have a version of ArcMap installed on the computer you are running it on.

Dr Google has some examples of code snippets that require QGIS if you don't have an Arc* product installed

kanchanarajapaksha
New Contributor

Hello, Thanks for the details. Can we write python code without using the

arcpy library for shapefile to kml conversion?

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

never seen a pure python library, since you need at least a library to deal with the shapefile part

0 Kudos
kanchanarajapaksha
New Contributor

Hello,Can we make a library of arcgisscripting using python code?

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

you need arcmap or ArcGIS pro or some other gis open alternative

That is it

0 Kudos
ZackaryKing
New Contributor II

Hi Kanchana,

If you don't have a version of ArcGIS installed on your computer you won't be able to access the arcpy module with python.

An other really easy way to convert spatial formats with python is to use GDAL/OGR.

This link will walk you through how to write to kml:

Geometry — Python GDAL/OGR Cookbook 1.0 documentation 

kanchanarajapaksha
New Contributor

Thanks for your advice.By the way, how can I get the arcgisscripting

library for my project.Because when I run the standalone query,it says this

library is missing.But it is in the ARCGis installation folder.Without the

ARCGis installation,I cannot run the standalone program

0 Kudos