conert shp into wkt or geojson

6974
7
09-27-2017 03:35 AM
francescarusso
New Contributor III

Hi all,

does anyone know how can I convert a shapefile (line) in a wkt or geojson format?

I have Desktop  ArcGIS 10.2.

Many thanks

F

7 Replies
DanPatterson_Retired
MVP Emeritus

lots of 'from' conversions... but little hope with a 'to' conversion using 10.2.  Are you just looking for Arc* conversions or have looked looked outside to other options?

francescarusso
New Contributor III

Dan Patterson wrote:

lots of 'from' conversions... but little hope with a 'to' conversion using 10.2.  Are you just looking for Arc* conversions or have looked looked outside to other options?

Basically I have to import the shp in a software which apparently is not very flexible regarding projections (Only WGS84). In fact it is not reading some of my shapefiles. So I have been suggested that if  my shp are already in WGS84 geographic coordinates then I have to export to a minimalist format as wkt or geojson and reimporting to GIS and defining the projection as WGS84 (EPSG 4326).

As from my xperience I have never heard about thesefile format, I have done some research and it seems like I can do something with Phyton??I have no clue on how to use it so I tried to use the conversion tool "Json to Features"...not sure I have done the right thing as it seems to make no difference..not sure also on what does this "conversion tool" do to my shapefile. What is it for?

Any suggestion really much appreciated.

Cheers,

0 Kudos
NeilAyres
MVP Alum

It is very easy to re-project data from one coordinate system to another.

Either use the Project Tool in Data Management / Projections and Transformations,

or (which I use often),

with the data in ArcMap, change the coordinate system of the data frame to the desired projection and then export the data in the coord sys of the df.

Just check the actual coordinate system of the data using Arc Catalog, right click on the data and get the properties / Coord sys page.

What software are you trying to import data into?

NeilAyres
MVP Alum

I see that the latest DNR GPS utility has an option to export to geojson.

DNRGPS Application: Minnesota DNR 

VinceAngelo
Esri Esteemed Contributor

There are tons of examples of queries using a DA Cursor (arcpy.da.SearchCursor) to select the WKT ('shape@wkt') or Esri JSON ('shape@json')  from a layer source. Take a stab at it, and post your code if you run into trouble.

- V

JoshuaBixby
MVP Esteemed Contributor

Starting with ArcGIS 10.5.x, Features To JSON—Help | ArcGIS Desktop supports a geoJSON argument.

TedKowal
Occasional Contributor III