[OpenLayers-Users] Fwd: Importing JSON to WKT

Joel Leininger leiningr at gmail.com
Tue Jul 10 11:22:57 PDT 2012


Sorry, should have hit reply to all.

---------- Forwarded message ----------
From: Joel Leininger <leiningr at gmail.com>
Date: Tue, Jul 10, 2012 at 2:21 PM
Subject: Re: [OpenLayers-Users] Importing JSON to WKT
To: Greg Allensworth <gregor at greeninfo.org>


Okay, here is that output:

Object { status="added", numResults=1, 0=[1]}
 ["MULTIPOLYGON(((-8528843...591 4765443.37168208)))"]

That looks right to me. Not sure of the nomenclature "0=[1]" but [1] could
reflect the wkt object. The second line is what I'm trying to feed into the
read statement, and it looks correct -- except the brackets. Does firebug
add those or would they be in the json?


On Tue, Jul 10, 2012 at 11:38 AM, Greg Allensworth <gregor at greeninfo.org>wrote:

> On 7/9/2012 7:44 PM, Joel Leininger wrote:
>
>>  updateJson = new OpenLayers.Format.JSON();
>>  updateOutput = updateJson.read(updateRequest.**responseText);
>>  console.log(updateOutput);
>>  console.log(updateOutput[0]);
>>
>>  updateStatus = updateOutput.status;
>>  if (updateStatus == 'added') {
>>  new polygone = parcer.read(updateOutput[0]);
>>
>
> Try adding console.log lines as I indicated above, and reading Firebug's
> output. The value of "updateOutput" is the parsed JSON object/array -- are
> you positive that it's an array of plain strings in WKT format, and not an
> array of objects that have a property storing the WKT, nor a single plain
> string?
>
> --
> Greg Allensworth, Web GIS Developer
> BS  A+  Network+  Security+  Linux+  Server+
> GreenInfo Network - Information and Mapping in the Public Interest
> 564 Market Street, Suite 510  San Francisco CA 94104
> PH: 415-979-0343 x302  FX: 415-979-0371    email: gregor at greeninfo.org
> Web: www.GreenInfo.org     www.MapsPortal.org
>
> Subscribe to MapLines, our e-newsletter, at www.GreenInfo.org
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120710/7d76bdc2/attachment-0001.html>


More information about the Users mailing list