[OpenLayers-Users] Importing JSON to WKT

Greg Allensworth gregor at greeninfo.org
Tue Jul 10 14:56:31 PDT 2012


On 7/10/2012 2:47 PM, Joel Leininger wrote:
> That's true, we do control both sides of that transaction.
> Any ideas why we should have to resort to this??

No, it sounds very strange. Looking at the JSON parser source code

I do notice one thing: console.log(updateOutput[0]) is showing 
"["MULTIPOLYGON(((-8528843...591 4765443.37168208)))"]" with the 
brackets, indicating that it's an array.

What if you do this? Does it show a single string?
console.log(updateOutput[0][0]);

What about this?
console.log(typeof updateOutput[0]);
console.log(typeof updateOutput[0][0]);


And you're sure of the behavior:

// works?
new polygone = parcer.read("MULTIPOLYGON(((123 456)))");

// fails?
var wkt = "MULTIPOLYGON(((123 456)))";
new polygone = parcer.read(wkt);

-- 
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




More information about the Users mailing list