Adding KML to OpenLayers as a textstring

I am trying to display a kml as a vector Layer. I have it stored as a Perl scalar variable but have also tried setting it as a javascript variable. I've tried to separate bits of code that I got from questions on here. The first one produces no error but the vector_layer doesn't display http://www.geos.ed.ac.uk/~s0825955/cgi-bin/maps4.pl:               var kml_string = '<?xml version="1.0" encoding="utf-8" ?><kml xmlns="http://www.opengis.net/kml/2.2"><Document><Folder><name>scotland_one_inch_1st</name><Schema name="scotland_one_inch_1st" id="scotland_one_inch_1st"><SimpleField name="Name" type="string"></SimpleField><SimpleField name="Description" type="string"></SimpleField><SimpleField name="SHEET" type="string"></SimpleField></Schema><Placemark><name>John Thomson, Linlithgowshire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Linlithgowshire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.8271,56.0204 -3.3023,56.0204 -3.3023,55.8149 -3.8271,55.8149</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Stirlingshire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Stirlingshire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.6992,56.2988 -3.6282,56.2988 -3.6282,55.8927 -4.6992,55.8927</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Berwick-Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Berwick-Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-2.9047,55.944 -2.0344,55.944 -2.0344,55.5665 -2.9047,55.5665</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Peebles-Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Peebles-Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.5401,55.8247 -2.9182,55.8247 -2.9182,55.403 -3.5401,55.403</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Kirkcudbright-Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Kirkcudbright-Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.6636,55.3226 -3.563,55.3226 -3.563,54.7662 -4.6636,54.7662</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Edinburgh Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Edinburgh Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.7407,55.9899 -2.8252,55.9899 -2.8252,55.6441 -3.7407,55.6441</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Northern Part of Lanarkshire. Southern Part....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Northern Part of Lanarkshire. Southern Part....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.3831,55.9402 -3.394,55.9402 -3.394,55.2893 -4.3831,55.2893</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Haddington....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Haddington....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.0132,56.0792 -2.364,56.0792 -2.364,55.8175 -3.0132,55.8175</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Orkney Islands....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Orkney Islands....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.4344,59.3921 -2.3736,59.3921 -2.3736,58.6868 -3.4344,58.6868</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Roxburghshire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Roxburghshire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.1198,55.7047 -2.1658,55.7047 -2.1658,55.1084 -3.1198,55.1084</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Kincardine Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Kincardine Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-2.7564,57.1307 -2.0535,57.1307 -2.0535,56.7444 -2.7564,56.7444</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Caithness Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Caithness Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.8585,58.6938 -3.024,58.6938 -3.024,58.1369 -3.8585,58.1369</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Western Isles....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Western Isles....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-7.698,58.5156 -6.1365,58.5156 -6.1365,56.7781 -7.698,56.7781</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Dumbartonshire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Dumbartonshire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.8813,56.3316 -3.8628,56.3316 -3.8628,55.8899 -4.8813,55.8899</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Buteshire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Buteshire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-5.3982,55.9269 -4.899,55.9269 -4.899,55.424 -5.3982,55.424</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Sutherland Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Sutherland Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-5.4047,58.6275 -3.5972,58.6275 -3.5972,57.8487 -5.4047,57.8487</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Northern Part of Argyll Shire. Southern Part....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Northern Part of Argyll Shire. Southern Part....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-7.1189,56.8668 -4.5622,56.8668 -4.5622,55.2767 -7.1189,55.2767</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Selkirk Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Selkirk Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.3554,55.6913 -2.763,55.6913 -2.763,55.3408 -3.3554,55.3408</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Skye Island, &#38;c....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Skye Island, &#38;c....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-6.7898,57.7461 -5.648,57.7461 -5.648,56.8242 -6.7898,56.8242</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Northern Part of Angus Shire. Southern Part....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Northern Part of Angus Shire. Southern Part....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.4065,56.9857 -2.3875,56.9857 -2.3875,56.4327 -3.4065,56.4327</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Northern Part of Ross and Cromarty Shires. Southern Part....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Northern Part of Ross and Cromarty Shires. Southern Part....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-5.8722,58.1262 -3.7721,58.1262 -3.7721,57.0951 -5.8722,57.0951</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Northern Part of Aberdeen &#38; Banff Shires. Southern Part....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Northern Part of Aberdeen &#38; Banff Shires. Southern Part....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.8016,57.7065 -1.7667,57.7065 -1.7667,56.8723 -3.8016,56.8723</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Perthshire with Clackmannan....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Perthshire with Clackmannan....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.8529,56.9484 -3.0572,56.9484 -3.0572,56.0796 -4.8529,56.0796</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, County of Wigtown or Shire of Galloway...</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, County of Wigtown or Shire of Galloway...</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-5.1864,55.0613 -4.3442,55.0613 -4.3442,54.6336 -5.1864,54.6336</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Renfrew Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Renfrew Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.8985,55.9624 -4.226,55.9624 -4.226,55.6724 -4.8985,55.6724</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Fife with Kinross Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Fife with Kinross Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.7405,56.453 -2.5472,56.453 -2.5472,56.0059 -3.7405,56.0059</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Northern Part of Ayrshire. Southern Part....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Northern Part of Ayrshire. Southern Part....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-5.1242,55.8898 -3.9608,55.8898 -3.9608,54.9976 -5.1242,54.9976</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Dumfriesshire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Dumfriesshire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.1218,55.4606 -2.857,55.4606 -2.857,54.9645 -4.1218,54.9645</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Shetland Islands....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Shetland Islands....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-2.1162,60.8545 -.7347,60.8545 -.7347,59.5132 -2.1162,59.5132</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Nairn and Elgin....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Nairn and Elgin....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.0087,57.7248 -2.9907,57.7248 -2.9907,57.2932 -4.0087,57.2932</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Northern Part of Inverness Shire. Southern Part....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Northern Part of Inverness Shire. Southern Part....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-6.0806,57.6319 -3.4317,57.6319 -3.4317,56.6859 -6.0806,56.6859</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark></Folder></Document></kml>'; // you kml text stored as a javascript string     var kmlParser = new OpenLayers.Format.KML({extractAttributes: true});     var featurelist = kmlParser.read(kml_string);          var vector_Layer = new OpenLayers.Layer.Vector(featurelist);      Here is a second attempt. It produces `Uncaught SyntaxError: Unexpected identifier` when I try and add controls `select = new OpenLayers.Control.SelectFeature(vector_Layer);`. http://www.geos.ed.ac.uk/~s0825955/cgi-bin/maps3.pl               var vector_Layer = new OpenLayers.Layer.Vector();          function GetFeaturesFromKMLString (strKML) {         var format = new OpenLayers.Format.KML({            'internalProjection': myMapObject.baseLayer.projection,             'externalProjection': new OpenLayers.Projection("EPSG:4326")         });         return format.read(strKML);     };          vector_Layer.addFeatures(GetFeaturesFromKMLString('<?xml version="1.0" encoding="utf-8" ?><kml xmlns="http://www.opengis.net/kml/2.2"><Document><Folder><name>scotland_one_inch_1st</name><Schema name="scotland_one_inch_1st" id="scotland_one_inch_1st"><SimpleField name="Name" type="string"></SimpleField><SimpleField name="Description" type="string"></SimpleField><SimpleField name="SHEET" type="string"></SimpleField></Schema><Placemark><name>John Thomson, Linlithgowshire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Linlithgowshire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.8271,56.0204 -3.3023,56.0204 -3.3023,55.8149 -3.8271,55.8149</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Stirlingshire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Stirlingshire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.6992,56.2988 -3.6282,56.2988 -3.6282,55.8927 -4.6992,55.8927</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Berwick-Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Berwick-Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-2.9047,55.944 -2.0344,55.944 -2.0344,55.5665 -2.9047,55.5665</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Peebles-Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Peebles-Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.5401,55.8247 -2.9182,55.8247 -2.9182,55.403 -3.5401,55.403</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Kirkcudbright-Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Kirkcudbright-Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.6636,55.3226 -3.563,55.3226 -3.563,54.7662 -4.6636,54.7662</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Edinburgh Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Edinburgh Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.7407,55.9899 -2.8252,55.9899 -2.8252,55.6441 -3.7407,55.6441</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Northern Part of Lanarkshire. Southern Part....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Northern Part of Lanarkshire. Southern Part....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.3831,55.9402 -3.394,55.9402 -3.394,55.2893 -4.3831,55.2893</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Haddington....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Haddington....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.0132,56.0792 -2.364,56.0792 -2.364,55.8175 -3.0132,55.8175</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Orkney Islands....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Orkney Islands....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.4344,59.3921 -2.3736,59.3921 -2.3736,58.6868 -3.4344,58.6868</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Roxburghshire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Roxburghshire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.1198,55.7047 -2.1658,55.7047 -2.1658,55.1084 -3.1198,55.1084</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Kincardine Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Kincardine Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-2.7564,57.1307 -2.0535,57.1307 -2.0535,56.7444 -2.7564,56.7444</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Caithness Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Caithness Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.8585,58.6938 -3.024,58.6938 -3.024,58.1369 -3.8585,58.1369</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Western Isles....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Western Isles....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-7.698,58.5156 -6.1365,58.5156 -6.1365,56.7781 -7.698,56.7781</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Dumbartonshire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Dumbartonshire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.8813,56.3316 -3.8628,56.3316 -3.8628,55.8899 -4.8813,55.8899</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Buteshire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Buteshire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-5.3982,55.9269 -4.899,55.9269 -4.899,55.424 -5.3982,55.424</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Sutherland Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Sutherland Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-5.4047,58.6275 -3.5972,58.6275 -3.5972,57.8487 -5.4047,57.8487</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Northern Part of Argyll Shire. Southern Part....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Northern Part of Argyll Shire. Southern Part....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-7.1189,56.8668 -4.5622,56.8668 -4.5622,55.2767 -7.1189,55.2767</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Selkirk Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Selkirk Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.3554,55.6913 -2.763,55.6913 -2.763,55.3408 -3.3554,55.3408</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Skye Island, &#38;c....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Skye Island, &#38;c....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-6.7898,57.7461 -5.648,57.7461 -5.648,56.8242 -6.7898,56.8242</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Northern Part of Angus Shire. Southern Part....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Northern Part of Angus Shire. Southern Part....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.4065,56.9857 -2.3875,56.9857 -2.3875,56.4327 -3.4065,56.4327</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Northern Part of Ross and Cromarty Shires. Southern Part....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Northern Part of Ross and Cromarty Shires. Southern Part....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-5.8722,58.1262 -3.7721,58.1262 -3.7721,57.0951 -5.8722,57.0951</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Northern Part of Aberdeen &#38; Banff Shires. Southern Part....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Northern Part of Aberdeen &#38; Banff Shires. Southern Part....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.8016,57.7065 -1.7667,57.7065 -1.7667,56.8723 -3.8016,56.8723</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Perthshire with Clackmannan....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Perthshire with Clackmannan....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.8529,56.9484 -3.0572,56.9484 -3.0572,56.0796 -4.8529,56.0796</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, County of Wigtown or Shire of Galloway...</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, County of Wigtown or Shire of Galloway...</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-5.1864,55.0613 -4.3442,55.0613 -4.3442,54.6336 -5.1864,54.6336</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Renfrew Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Renfrew Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.8985,55.9624 -4.226,55.9624 -4.226,55.6724 -4.8985,55.6724</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Fife with Kinross Shire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Fife with Kinross Shire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.7405,56.453 -2.5472,56.453 -2.5472,56.0059 -3.7405,56.0059</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Northern Part of Ayrshire. Southern Part....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Northern Part of Ayrshire. Southern Part....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-5.1242,55.8898 -3.9608,55.8898 -3.9608,54.9976 -5.1242,54.9976</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Dumfriesshire....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Dumfriesshire....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.1218,55.4606 -2.857,55.4606 -2.857,54.9645 -4.1218,54.9645</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Shetland Islands....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Shetland Islands....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-2.1162,60.8545 -.7347,60.8545 -.7347,59.5132 -2.1162,59.5132</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Nairn and Elgin....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Nairn and Elgin....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.0087,57.7248 -2.9907,57.7248 -2.9907,57.2932 -4.0087,57.2932</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>John Thomson, Northern Part of Inverness Shire. Southern Part....</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">John Thomson, Northern Part of Inverness Shire. Southern Part....</SimpleData></SchemaData></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-6.0806,57.6319 -3.4317,57.6319 -3.4317,56.6859 -6.0806,56.6859</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark></Folder></Document></kml>'))      I thought It should have a semicolon at the end but it spat that out. So what I want to ask is which technique would you recommend I persevere with and what do I need to fix? EDIT: after adding a ) to the second attempt I no longer get an error but have the same problem as I have in the first one


How to define coordinate system and geographic transformation for a CAD drawing?

I am a GIS guy and I occasionally work with CAD files as well. Now I need to know how I can define a coordinate system and a geographic transformation for a CAD Drawing. According to ESRI: _"You can define a coordinate system and a geographic transformation and create and edit metadata for CAD datasets. The information is stored in external support files and moves with the CAD dataset when it is managed in the Catalog window."_ But don't know how to do this! Can you please let me know or point me to a tutorial to understand this?


Using Matlab to build adjacency matrix from Arcmap OD Matrix table

I was trying to use the function Network Analyst in Arcgis to generate the network to display the small world phenomenon, so i have to transport the shapefile (which contains originalID &destination ID & degree data)for Matlab to use it for further geostatistical analysis, so I was wondering that how to transfer the data to adjacency matrix for further calculations. (My shapefile type is polyline or point.) No need for weights, just the 0,1 matrix, further calculation is for the path length and clustering coefficient. thanks a lot!


Linking multiple map displays in Internet Map Server (IMS)?

Has anyone heard of any GIS Internet Map Server (IMS) capability program that will allow multiple displays of data to be geo linked. For example, when one pans on one view it will automatically relocates the extent on the corresponding linked viewer.


Can custom map tiles be consumed via ArcObjects within my ArcGIS 10 Desktop AddIn?

Can I programmatically consume and render custom map tiles in ArcMap via our ArcGIS 10 Desktop AddIn? The AddIn is built using the ArcObjects SDK for C#/.NET and ArcGIS 10. Pulling and rendering map tiles is NOT the AddIn's primary function. But we would definitely like to implement this feature if it can be done. More specifics:   * I received a tip that the ITiledMapServer2 interface is involved but it is unclear to me, and there is a dearth of info in ArcObjects docs regarding this task. The equivalent class within the ArcGIS for Flex API is TiledMapServiceLayer, but again this is an ArcMap AddIn in the desktop space, not a web app.   * We have in-house software to generate our own tiles in the same zoom, tile Y, tile X tiling scheme akin to the Google maps JS/Flash APIs.   * We are using Apache to serve the map tiles and thus are currently not using ArcGIS Server in any way (i.e. authoring the tiles, publishing as an ArcGIS Server map service, etc).   * I've posted the question to SO and received a recommendation to post here. Thank you in advance.


Is it possible to emulate "Swiss style" shaded relief with ArcGIS tools?

Is there a way to create a Swiss style (or other hand-shaded-like styles) shaded relief from a dem using ArcGIS tools alone?


Disable Panning in ArcGIS Silverlight Map

Is there a way to disable panning when using the ArcGIS Silverlight API? Other than enabling a Draw object.


Openlayers multiple zoom problem

I have a simple WebGIS with Mapserver, Tilecache and Openlayers. This project has something like 12 zoom levels. The problem is when I zoom for several layers (say 8 lavels), it becomes very slow, since it tries to load images for all the previous 8 zoom levels. Has nay body have any idea how to overcome this problem?


Is it possible to open ModelBuilder SCREEN from .NET base command class?

I simply want to open the custom model's SCREEN (ModelBuilder) from .NET.


How to covert gridded (gnomonically projected by distance) data to lat/long data

I have a grid of data that is in a gnomonic projection, centered on a lat/long point (WGS-84). The grid has a 1km spacing. Given this I can easily obtain the x,y coordinates/distances from centre point where the latitude and longitude is known. What is the best way to obtain the lat/long for any arbitrary datum in this grid (ie, how can I create a grid of lat/long pairs)?


Where can I find a good Mbtiles to png tiles converter?

I'm trying to create a slippy map and I need to obtain png tiles. I have exported a .mbtiles file from TileMill and I tried several python scripts to convert this file into png tiles but I always end up with a messy folder where the tiles are misnamed, and I can't use them into my app. Does anyone know a good converter which organize and name your tiles properly ?   Thanks in advance !


How to Start Web Mapping?

I want to start working on a web map at work to map some of our statistics by city. I have an idea, but I'm not exactly sure where to start. Are there any definitive resources that provide step by step guidance on how to do this?


Beginner web mapping advice

> **Possible Duplicate:**   >  Steps to Start Web Mapping I'd like to get some expert opinions on how to get started in web mapping. First, a bit about my skills, then what I'd like to do. I've got many years of experience with GIS, mapping, and cartography. And I'm pretty good with PHP, mySQL, HTML, and CSS. But I now need to bring all of that together into a web mapping project (I can't avoid it any longer!). What I want to build is a mapping site where I can have something like a Google or Bing map base, then on top of that bring in my own township grid, and many thousands of points, with several pieces of data for each one. These points will represent wells or sampling points and will be updated monthly, and some of them will be updated daily. I'd even really like to have it so that users can add their own information to these points, and I'd really really like to have users able to draw in their own lines and polygons, and text tabels. So without opening up a giant can of worms, is there a general type of approach to something like this? I'm looking at Manifold [which I already use] and mapserving.com, or MapserverPro and one of the mapping packages they provide. What about OpenLayers and embedding OL maps right into my own pages? Jim If anyone can steer me in the right direction with some general advice, I'd sure appreciate it!


Getting into WebMapping

I've been experimenting with leaflet and google maps javascript api to build some very simple maps on my local machine. However, I'm searching for a tutorial or any advice to get started with using my own shapefiles and datasets and integrating them with the webmap and putting it onto a website. I've heard using an Apache web server is the best way to do this? Can someone explain how the whole process works between client, data, and webmap? If there are any tutorials aimed at beginner web mappers too that would be great. Thanks so much.


Setting up an online map site

> **Possible Duplicate:**   >  Steps to Start Web Mapping I have taken on setting up a database which stores information of an annual country-wide survey of alien aquatic weeds, linked to a GIS program to map the sites and attributes. For my database I am using postgres, with qgis for the mapping. The eventual aim is to publish it online for anybody to access, and get basic maps detailing the surveys. I have been going around in circles trying to understand what process to follow. What tools do I need to get from my qgis map to an online map, and what is the basic outline of the process I need to follow? I have managed to derive a map and attributes from my database. Thanks, any help is greatly appreciated.


making a interactive map

I have a georeferenced map that gives a view of 3D,which I have created in ArcScene and exported as jpeg(or tif if necessary).What I want to do is create a interactive map that allows user to click on a certain building on that image and a marker that shows the information about that building appears...and also the options of zooming,panning and scale displaying would add favour to the map... Is there a way that one can give the coordinate extent of that image and marker be displayed on exact certain LatLong?Or is there other way around to deal with it please suggest...I looked upon internet and came up with nothing


How to start WebGIS for broke people?

I want to make a web GIS system. I will be graduating in 3 months and have time on my hands before going for interviews. if i can build something then i can show it off in the interviews and hopefully make me stand out. However how do i go about this with zero budget but i have lots of public data from university?


overlay my shapefiles stored in database to the web/browser

I am very much strrugling on how to display my shapefiles stored in postgis database to the browser or to the web.. is there anyone there knows how to do it.? I am using geodjango framework in python,. I already achieve the displaying of maps in admin interface but when I create my public page for displaying the maps, its make my head aching,.I did not konow how to overlay my shapefiles stored in database to the base map openlayers / openstreetmap.


Development guide for beginner?

Im new to GIS and mapping, and I need to learn how to create web map application for my project. I'm really confused on what to use. I have read PostGIS, OpenStreetMap, and Openlayer. I'm wondering how those API's work together. I'm an experienced PHP programmer, so is there a way that I can apply my PHP skills? Later on this project, I'll be calculating the shortest path and creating a routing guide. Can you guys suggest a best guide for accomplishing my project? Also, is there a way that I can use only domain server or host like bluehost? Since I'm only required to work within a small town? Thank you!


free webgis environment solution?

> **Possible Duplicate:**   >  Steps to Start Web Mapping soon I will be trusted to develop a webgis system. This project will take an advantage of a currently developed business system. The business system is using pure PHP, Java and MySQL. The project plan is to embedded a mapping system so the management will be able to see all the report tables (from the business system) and when they click on some "numbers" they can view the map as well. I guess it's a standar nowadays. What I'm hoping to get answer is what free webgis environment that you are suggesting to accomplished this? I'm not new in webgis but I'm not following the recently updated information about this webgis environment. Mostly I'm using desktop GIS. Thank you.


Online GIS app that allows users to log points

I am developing a website for a dolphin volunteer group, on this website they want a system to let volunteers and the public log sightings against a map and add some comments. I have made a system using the google maps API and a database, which does the job but will need more work. I was just wondering if there is a web based, simple GIS framework that would do the same thing? They are just using it to gather data for research purposes, so something open-source or freely useable for this purpose would be what we are after.


Web Mapping Tips

I'm willing to learn web mapping but the problem is I'm quite confused. Please recommend about the tools (software), books and websites that I must go through!


Getting started to Web GIS development using JAVA

I am a newbie in GIS web development with java. I am starting to chose the tools(open source) to start with. Can i use degree with eclipse or should i use geomajas instead. thank you


What software is required to run the Web wigs?And what are the steps to set it up?

I want my laptop to start a WEBGIS. But I do not have any information about Web wigs. I can easily work whith Desktop GIS. and I am familiar with the GIS discussions.


Creating a Simple, Free Web Mapping Application

I have recently left my job as a GIS Specialist that I've held for a number of years. This was my first GIS job and I managed to lean a lot. Now that the holidays are over, I've decided to search for the next position. Obviously, someone in my position should want to garner a few new skills while I'm on the job hunt. One thing that I didn't have a chance to work with, is web mapping applications in my previous position. It's a skill I'd really like to pick up because it's the present and future of GIS. My idea is, to start an online resume of sorts. Something I can create and send to prospective employers to show I can work in the GIS environment. Although resumes are great, I feel like this is a lot more tangible than spitting out a bunch of facts about what I do in a resume. When I was hiring people, I had a few people do this sort of thing and I find I have a lot more confidence in people I hire because I can see what they are capable of. I'm wondering, for all of you who work with web mapping, where should I start? I want to start simple, but have the ability to expand when I get comfortable with it. I'm not willing to fork out money for ESRI products because, well.....I'm unemployed. I want to start working on some open source freeware products. I think Quantum GIS with the OSGEO package seems to be the most popular? I've worked with QGIS in my previous position for desktop and development applications, but I haven't created a web application. What other good, free products are out there that you have used with some success. Is there anything really cool in open source like 3D mapping? I was thinking about creating a 3D fly through tour video using some DEM's or LiDAR if I can get my hands on that sort of data. Any thought, suggestions? Thanks, Mike


GIS web development

> **Possible Duplicate:**   >  Steps to Start Web Mapping I want to create a Web GIS using an open source software.Also the software should be capable of importing shape files and kml.I have good knowledge in Visual Studio .Net 2005.So kindly suggest me some good software.


Maps hosted on my own server instead of ArcGIS servers?

I know ArcGIS provides maps for me to use off of their server for the price of their services. http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000003vt000000 I want to share my map with other clients without requiring them to buy a license or anything. Is it possible for me to use my own map hosted on my own server, maybe something like google maps for free? The closest option I have seen is OpenStreetMap http://www.openstreetmap.org/. I want to add all the same layers as ArcGIS such as legend, shapes and editing.


Where/How to Learn about Getting Started with Web GIS

> **Possible Duplicate:**   >  Steps to Start Web Mapping Does anyone know of any classes or resources where I could learn about WebGIS? I'd like to learn the steps and technology involved. I'd be looking for something online or live in the San Francisco Bay Area. Thanks


Qgis dynamic web maps

I am new (Mac lion 1.8.3) Qgis 1.8 user . It was very easy till now to make a map. But now I am facing the next step that is out of my knowledge. I want to publish dynamically the map to my web page. Is that step so difficult? Is there any tutorial? Can you give any help?


Good Learning Resources

I am very new to the GIS, maps, openlayer , mapserver etc Can someone recommend some good intro resources that can start from basics and build up. Thanks


Simulating historic GPS data on map

I have some really basic newbie questions. I have following data with me: ESRI Shape files (.shp, .shx, .dbf, .prj, .sbn and .sbx)   KML/KMZ files   GPS coordinates (~400k) of some cars (~50) tracked for a week (csv file with lat, longs and timestamps) **_End Goal_** :   1) First, I want to overlay this data on some web-based system (like google maps), so that I can embed it in my website (I have the flexibility of running a server if a solution requires that).   2) On top of this layer, I want to overlay the gps coordinates based route for each of the cars. The end user should be able to select some of the cars and the routes for only those cars should be visible.   3) Finally, I should be able to simulate the routes, something similar to this http://hobbycoders.com/demos/gpssimulation/ **_Problem_** : If someone can direct me to the right set of tools/technologies that I should use to implement this. As of now I am just hopping from one technology to another without knowing what I should choose. The shapefiles are for some hypothetical place in the middle of pacific ocean.


Choosing web mapping API to use with MySQL for making map of one country?

I hope this question isn't too general, but I'm new to using maps, I'd like to make a map of one country on which I can plot points according to their geocodes from my mysql database, and to have the administrative districts outlined, like on google maps api, except I have read that google maps doesn't allow you to show just one country, and also, I'd like to use a free api if possible. Would anyone be able to point me in the right direction?


Can We build a search function using GeoExt?

Or do I need another technology? I need to build a web gis server and I need map display, layers switch, search function and attribute display feature. I am currently using GeoServer, OpenLayers and GeoExt.


loading multiple shapefiles using shp2pgsql in a bash script

I have this bash script (loadShapefiles.sh) to load multiple shapefiles at a time. The script and the shapefiles are stored in the same directory. When I run the bash file with the command of `bash loadShapefiles.sh`, I have this error message: `syntax error near unexpected token '$'do\r''` I appreciate your suggestions to fix this problem!               for f in *.shp     do         shp2pgsql -d -I -s 2913 $f rlis.`basename $f .shp` > `basename $f .shp`.sql       done              for f in *.sql       do           psql -d portland -f $f       done


Where can I find a comprehensive overview of QGIS geoalgorithms?

i am looking for an overview of processing toolbox / qgis geoalgorithms tools   unfortunately the link http://www.qgis.org/de/docs/user_manual/processing/toolbox.html seems to be dead. SEXTANTE ... (which apparently (?) is the ancestor) doesn't provide any up to date documentation does anyone have any idea where to find a comprehensive tool-reference including detailed description of in- out-put and parameters ?


Is my Geoserver "Direct WMS Integration" working?

I have activated the "Enable direct WMS Integration" switch in Geoserver 2.5. As far as I can understand, this enables caching of layers without having to use the "gwc/service/wms" endpoint in the WMS URL. I assume that this enables geowebcache tilecaching dynamically when the tiles are requested. However, I am not seeing the correponding cache being created in the gwc directory in geoserver_data_dir. Is it working? How can I tell?


Dismiss invalid Polygons in PostGIS

I Have a massive Dataset from OpenStreetMap and imported it into a Postgres- Database using ogr2ogr. I got several warnings during this process because of multipolygons with too little vertices. Now I can’t transform the data in the Database using PostGIS, because of this invalid features. It is no Problem to losse the invalid features but I don't know how to delete them or correct them. I tried: `ALTER TABLE multipolygons ALTER COLUMN wkb_geometry TYPE geometry USING ST_Transform(ST_MakeValid(ST_SetSRID(wkb_geometry,4326)),3857);` But I got the error Message: `Polygon must have at least four points in each ring` Any recommendations? Thx! UPDATE: I tried: `Alter table multipolygons ADD COLUMN wkb_geom_valid geometry; Update multipolygons SET wkb_geom_valid = ST_MakeValid(wkb_geometry);` `delete from multipolygons where ST_NPoints(wkb_geometry)<4 ;` `select * from multipolygons where ST_isvalid(wkb_geometry)=TRUE ;` All without success...


Changing tracks to vectors in a grid

This is a version of a question that I posted on the GRASS list, but I didn't get any suggestions there. I would like to overlay a grid (cell size about 500 m x 500m) over an animal track created from hourly locations. For each cell that contains a track segment I want to record a direction vector which represents the direction that the animal was traveling when it passed through that cell. I tried using the GRASS command "v.to.rast use=dir", which should create a directional vector in every raster cell that the track passes through. It almost works, but the command does not seem to respect the _order_ of the track. It seems just as likely to classify a particular segment as having a direction of NE as to classify the same segment as SW (180 degrees opposite) and I couldn't see any consistency to how the directions were chosen, although I may have missed something. Another challenge is that the animal often re- crossed its own track so that individual grid cells may contain more than one track segment--in those cases I want to sum the direction vectors using regular vector algebra. I am new to GRASS and a bit overwhelmed, and I would be very grateful for any suggestions that would get me started in the right general direction. Thanks!


Errors uploading plugin to QGIS python plugin repository

I'm trying to upload my first plugin to: http://plugins.qgis.org/plugins/add/ I keep getting the following error: > There were errors reading plugin package (please check also your plugin's > metadata). Package name must start with an ASCII letter and can contain > ASCII letters, digits and the signs '-' and '_'. My package name is "DEMTools" and I've checked the plugin's metadata file, but everything looks to be in order. This error message doesn't give me a lot to go on and I've never uploaded a plugin before. Are there some common issues I should look for or is there some detailed guide to preparing a plugin package for **upload**? (I don't need help with creating the plugin just uploading it to the Plugin Repository. I used Plugin Builder to create the plugin and it runs fine on my local machine.) Thanks for any help you can offer.


Arcgis AttributeEditor getcodedvalues of domain

i develop map project with arcgis android sdk, i searh attribute editor and i found one sample, it works but if my item field has codedvalue, it put edittext to UI but i want to add spinner and i want to do this manual so in AttributeListAdapter class they wrote comment for domain "if you want to support domains, add checks here and use the createSpinnerViewFromArray to create spinners " and i check my field also i can get my domain of field but i couldnt get my codedvalues. How can i do that ?


Where to get night satellite imagery of South Sulawesi, Indonesia

I need night satellite imagery of South Sulawesi, Indonesia but could not find any one my own. Does anyone know of sources? Free would be best but if quality and resolution is good i would also pay for them.


Problem with QgsVectorFileWriter

I am trying to write a python script that when it is called it will take an .sqlite layer and save it as a GeoJSON layer. This will be used in a leaflet app but for now my problem is with this script. This script was firstly written and tried in Ubuntu (with the correct prefixpath, database and vector layer directories for ubuntu of course!) and it worked perfectly! So i transfered it to Windows changed all the paths and added new data and now everything crashes... I have read PyQGIS Cookbook about loading and using vector layers and i wrote this script:               # -*- coding: utf-8 -*-     from qgis.gui import *     from qgis.core import *          QgsApplication.setPrefixPath("C:\\Program Files\\QGIS Valmiera\\bin", True)     QgsApplication.initQgis()          app = QgsApplication([], True)          uri = QgsDataSourceURI()     uri.setDatabase('C:\\project\\leaflet\\python_files\\test_files\\simeia_meleton_win.sqlite')     schema = ''     table = 'simeia'     geom_column = 'Geometry'     uri.setDataSource(schema, table, geom_column)          display_name = 'simeia'     vlayer = QgsVectorLayer(uri.uri(), display_name, 'spatialite')          if vlayer.isValid():         error = QgsVectorFileWriter.writeAsVectorFormat(vlayer, "simeia", "utf-8", None, "GeoJSON")         if error == QgsVectorFileWriter.NoError:             print "success!"          else:         print "Layer failed to load"          app.exitQgis()      First i tried to run it outside of the QGIS python console, in Pyscripter, and when i try to run it prints: `sys:1: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal` Then the PyScripter crashes! When i try to run it in the QGIS python console line by line and when i insert: `QgsVectorFileWriter.writeAsVectorFormat(vlayer, "simeia", "utf-8", None, "GeoJSON")` The QGIS prints Crash Dumped and then just crashes. Any thoughts anyone??


Inverse of Selected Records using ArcObjects?

What is the Process to find the inverse of selected data from featureclass using vb.net arcobject?


Carto-CSS/ Mapnik XML Text background color

I want to add a background color to my labels. How do I do that with Carto-CSS in Tilemill or with Mapnik? Carto-CSS               #marker_labels {       text-name: "[name]";       text-face-name:@sans;       text-size: 20;       text-fill: #FFFFFF;       text-allow-overlap: true,     }      Mapnik XML               <TextSymbolizer face-name="Air Soft Cond Heavy" size="20" fill="#ffffff" allow-overlap="true" ><![CDATA[[name]]]></TextSymbolizer>      Here is a example on how the label should look like (ignore the line to the label):![enter image description here](http://i.stack.imgur.com/uZasi.png)


CartoDB - How would I customize my legend to not be white and have blocks instead of bullets?

First off, CartoDB is amazing. I am trying to modify the look of my legend to look something like the one as seen on the "Elephant Movement in a Human Landscape" example on the CartoDB website. (http://spaceforgiants.org/?q=blog/2013/02/28/elephant-movement-in-a- human-landscape) ![Elephant Movement Customized Legend](http://i.stack.imgur.com/jb1Po.jpg) Similar to that example, my map has both point data and polygon data. I want to represent the point data with the standard bullets provided with the default category legend, but for the polygon layers I want to create colored (and also preferably semi-transparent) blocks. Is there any way I can make these stylistic changes within the UI/legends/custom html window? One last question, how would I go about changing the color of legend background? My code looks like this: EcoRegions   * Cascade Crest Montane Forest    * Cascade Subalpine/Alpine    * Pluvial Lake Basins    * Cold Wet Pumice Plateau Basins    * Deschutes River Valley    * Ponderosa Pine/Bitterbrush Woodland    * Pumice Plateau Forest    * John Day/Clarno Uplands    * High Lava Plains  I thought maybe I could replace the word "bullet" with something like "box" or "block" but it didn't work. I am not a programmer so don't laugh - I thought it was a good try. Anyway, thanks for your help! El_Tigre


Icon in my map using his natural size

I'd like to show the Icon in my map using his natural size (width and height original). How can i do it? Now i have this code:               var contextResource =      {         getWidthIcon : function(feature){             //i'm trying to get the current width         },         getHeightIcon : function(feature){             //i'm trying to get the current height             },              getMarker : function(feature)           {             // getting the icon with a rest reponse             var lstIcons = feature.attributes.satellites;             var sUrlIcon = "${sBaseURL}"+ feature.attributes.orientation;             for ( var n = 0; n < lstIcons.length; n++) {                 sUrlIcon = sUrlIcon + "/" + lstIcons[n];             }             return sUrlIcon;         },         getBackgroundMarker : function(feature)         {             ///blah blah blah             }                  return urlBackground;         },         getVisibility : function(feature)         {             ///blah blah blah         },         getLabel : function(feature)         {             ///blah blah blah         }          };          //This is my style builder     var resourceStyle = new OpenLayers.Style({         externalGraphic : '<% out.print("${getMarker}"); %>',         backgroundGraphic : '<% out.print("${getBackgroundMarker}"); %>',         graphicOpacity: 1,         graphicWidth: '<% out.print("${getWidthIcon}"); %>',         graphicHeight:'<% out.print("${getHeightIcon}"); %>',         label: '<% out.print("${getLabel}"); %>',         fontFamily: "Arial",         fontSize: '11px',         labelYOffset: -30,         labelOutlineColor: "white",         labelOutlineWidth: 3,         display: '<% out.print("${getVisibility}"); %>'     }, { context: contextResource });      If I put a fixed graphicWidth and graphicHeight works normally. I want to display icons in different sizes. Is it possible using this strategy? Thanks


Is there MapInfo Label Expression to label lots in format Map-Lot (017-001) with just Lot?

I am trying to label map lots in this format Map-Lot (017-001) and I was wondering if there was a label expression that would allow me to only show the lot number and not the map number. Any help would be greatly appreciated.


What are the white grids at 9.6953038715817,98.576672019046 in Google map?

A friend asked me to help interpret the white grids at 9.6953038715817,98.576672019046 in Goole map. In satellite image the grids are connected to rivers flowing into the Andaman sea. Most of the rivers are also covered with snow-white material. I guess the grids are for polluted water treatment. But these grids seem to lack patterns of water treatment plants. Can anyone help interpret these grids? Clues are also appreciated! Thanks in advance.


Creating TFW and PRJ files for folder of GeoTIFF files?

I have a folder which contains a large number of files in GeoTIFF format. I need to generate both PRJ and TFW files for each of these images. Is there some way to do this?


How to distinguish an installation of ArcView from ArcEditor?

How would I tell an installation of ArcView from ArcEditor, if looking at only the installed files? Specifically, how do I distinguish   * ArcView 9.3 from ArcEditor 9.3   * ArcView 10.0 from ArcEditor 10.0 For example, the file ArcSOC.exe indicates an installation of ArcGIS Server.


Converting KML files for use with Python library Shapely

I am trying to get a KML-file (wijken.kml) into Shapely. The KML-file is validated against the proper XML schema, so I guess the input is correct. Routes I have tried: ### 1) Converting to WKT or WKB format, and reading in with build in functions Conversion:               ogr2ogr -f CSV wijken.csv wijken.kml -lco GEOMETRY=AS_WKT     ogr2ogr -f SQLite wijken.wkb wijken.kml      In shapely:               from shapely import wkt, wkb     f = open('../kml/wijken.wkb')     wkb.load(f)       Which gives (same for `wkt()`):               ReadingError: Could not create geometry because of errors while reading input.      As it provides no further info, and the Python code wraps other (C?) libraries, I do not know what is wrong with the format. The CSV-file contains multiple columns, perhaps something is wrong there, but I have not found a comparable online WKT-example to test. ### 2) Converting to GeoJSON and using the build in Shapely `asShape` function               ogr2ogr2 -f GeoJSON wijken.json wijken.kml      In Shapely:               import json     from shapely.geometry import asShape     f = open('wijken.json', 'r')     js = json.load(f)     f.close()     asShape(js)      Which gives:               ValueError: Unknown geometry type: featurecollection      This error is the same for a minimal, valid GeoJSON example. Looking at the Shapley code, the problem is that basic GeoJSON types such as "Feature" and "FeatureCollection" are not recognised. It is not clear which route to take to get from GeoJSON features to features Shapely understands. ### 3) Read in KML with fastkml, which returns Shapely objects This works, but it seems to lose the properties/ExtendedData values in the KML (or at least does not pass it to the Shapely objects). I feel that I'm missing something, it can't be so hard to get data into Shapely. Can someone point me towards the most robust/a working solution?


Convert an ESRI File GDB Table to Access 2007 ACCDB table programmatically

Does anyone know of a method to convert an ESRI File Geodatabase Table into Access 2007 Table programmatically. I have been trying using the PYODBC library and a series of insert statements but am having difficultly with some of the data types and NULL values. Any help is appreciated. Basically an unload to Access.


How to reclassify grey scale tiff in qgis

I downloaded a raster image of the sea floor age. The values in band 1 ranges from -32768 to 32767. I need to reclassify it to no. of million of years to make sense of the data. How can I do so? I try to use Raster Calculator but I do not know how to input the syntax. Any kind soul able to help? Thanks.


Mapnik server with Navteq Data

Is anyone here using navteq data for a GIS app? I'd like to work with navteq data and using mapnik-tilecache as a WMS server. The reason is, I use OSM data as well on my other server. And as the two servers need to be interchangeable I have to stick to one software technology. Importing the .shp files in a PostGIS DB and adjust the .xml config file for the mapnik render engine seems to be the right strategy. Has anyone another idea, or can confirm this route?


What happens to a feature class when importing to a feature dataset?

I am creating a model that needs to ensure that all input datasets end up in the same coordinate system (among other things). I was originally going to batch project all of the datasets whether they need to be projected or not, but then there's the issue of assigning the correct geographic transformation. Then I remembered that all data that is input into a feature dataset has to be the same coordinate system, so I decided to put all the data into one. My question is: When a feature class is imported into a feature dataset that is of a different coordinate system, does it automatically project the data? What happens? I tested this myself on roads data and it seemed to project the data, as they lined up nicely with my other data. The thing is, no transformation was needed (and a transformation method was needed had I projected it), so it seems fishy that the data is just automatically projected. Maybe it makes a best guess?


define parameter descriptions in ESRI Python Toolbox

I'm trying to create some Python Toolboxes for our ArcMap application (e.g. MyTool.pyt) I can see that the help text is defined with the classes self.description attribute. However, once I run the program, and click into any of the parameter fields, the help/description text goes empty. I would like to be able to provide the description field for each parameter. How is this accomplished? EDIT: After some responses, I see that via the 'Item Description' right-click context menu there are many fields that may be populated. Is there a 'pythonic' way to do this? That is, just by embedding some attributes in the .pyt file classes? For instance, in the .pyt toolbox definition you have the Toolbox class:               import arcpy          class Toolbox(object):         def __init__(self):             """Define the toolbox (the name of the toolbox is the name of the             .pyt file)."""             self.label = "My Toolbox"             self.alias = ""                  # List of tool classes associated with this toolbox             self.tools = [MyNiceTool]               class MyNiceTool(object):         def __init__(self):             """Define the tool (tool name is the name of the class)."""             self.label = "My Tool Class"             self.description = """     A description that shows up in the help context side pane when the tool is launched.             """             self.canRunInBackground = True              def rest_of_required_methods....      From the self.description string the Tool dialog help window will display this text. However, what I am wanting to do is have a 'description' embedded in my code for each parameter also, so that when the tool is launched, and the user clicks into a parameter field, the parameter description is shown. If I were to do this using the 'Item Description' method referenced in the replies below, I would edit the fields Dialog Explanation under the Syntax section for each parameter... I guess.


Problems with connecting QDateEdit and QTimeEdit widgets to corresponding Field in QGIS Layer (shp/spatialite)

Could anybody give me a hint how to connect the QDateEdit and the QTimeEdit widgets with a field in a QGIS layer (shp or spatialite). The fields in the QGIS layers are from datatype "date" (dd.MM.yyyy) and "datetime" (HH:mm). ObjectName in **Qt-Designer** and the layer in QGIS are equal. For some reason the connecting doesnt work and the entry in my table stays "NULL". The binding with normal LineEdits works. I tried to describe my problem here but obviously I wasn't that precise. I'm not a programmer and until now I haven't worked with C++. Thanks in advance!


How to run an external program on "identify" on a WMS layer?

I have a QuantumGIS project with several WMS layers. When I select one of these, the identify-function shows a windows with more information on the feature I clicked. It gets this data from the GetFeatureInfo-request to the WMS. Now I would like to pass a part of that to an external program. All I have found so far is how to do this with actions, but these seem to work only on vector layers. Is there a way to accomplish this with a WMS layer and its GetFeatureInfo response? Thank you very much Norbert


When I export shapefiles from ArcMap 10 there appears to be no xml file created?

When I create shapefiles in ArcMap, be it by selecting certain features from existing data or creating new polygons/points/lines,   I look in My Computer and see a dbf prj sbn and sbx file.   These shapefiles all successfully open in ArcMap, but I'm trying to upload these shapefiles to Mangomaps.com and the lack of an shp file is crucial.   When I open up the shapefiles in ArcMap an shp mysteriously appears in the form of "(Whatever the name of my shapefile is).shp.URA-0422.6328.6588.sr.lock" URA is the name of the place where I work and just fyi before someone harps on me for sharing important information I changed some of those numbers in case they have significance.   However this locked shp can't be uploaded and immediately disappears once ArcMap closes.   What's going on? Do I have some sort of setting preventing ArcMap from creating an shp/xml document?


Are there any examples of the Esri GeoPortal REST API in use?

Are they any public examples of sites built on top of the Esri GeoPortal's REST API? I would like to use the back-end functionality of the GeoPortal to manage the metadata, but serve it up using a custom front-end. Before I undertake this task I'm interested to see whether anyone has successfully achieved this. Thanks.


Update shapefile data source with wildcard using python

I am attempting to update a layer's data source in Arcmap using python               for lyr in arcpy.mapping.ListLayers(mxd, "*", df):         if lyr.name == "project_whl":             lyr.replaceDataSource("F:\\Jobs2012\\05665\\EPASS\\", "SHAPEFILE_WORKSPACE","1205992_whl")      This WORKS! HOWEVER I would like to use a wildcard instead of explicitly stating the dataset_name Example below:               for lyr in arcpy.mapping.ListLayers(mxd, "*", df):             if lyr.name == "project_whl":                 lyr.replaceDataSource("F:\\Jobs2012\\05665\\EPASS\\", "SHAPEFILE_WORKSPACE","*whl")      Yet does not work, I have tried *, ?, %, _, & none of these work... Just get the following error message               <type 'exceptions.ValueError'>: Layer: Unexpected error      Your thoughts, ideas?


OpenLayers - Vector Layer and Google Maps - vector layer and google layers don't seem to be in sync when zooming on Chrome

I am working with a Google Layer and a vector layer in OpenLayers. I was wondering if anyone else noticed any problems with Chrome displaying Google Maps layers on OpenLayers? It seems that when I zoom, it is much slower than doing Google Maps by itself (say, at the google maps site). And when I zoom with a Vector Layer that has features, they don't zoom in sync with the google map. It seems like I zoom, and the vector layer will get more zoomed in much faster than the Google maps layer. I tried it in firefox and it seems to work much much better (still notice it if you zoom in super super fast, but it is barely noticable). I also noticed that the google layers have some kind of strange space between the tiles, like a 1px split between each map tile. For example this code will do it: http://openlayers.org/dev/examples/spherical-mercator.html But it works fine in Firefox. Does OpenLayers and Google Maps just not work well in Google Chrome?


Experiences with ArcGIS Data Interoperability

In order to import/extract data from tons of DWG files, I'd like to know experiences with ArcGIS Data Interoperability, and its strong points versus FME or GeoKettle. Thank you very much.


Is there a way to erase GeoTIFF header?

I've got some GeoTIFF files that have wrong bounding box extent and wrong CRS associated to. Fortunately I know the right CRS, but even associating it to the files (I've tried both with QGIS and ArcCatalog) their extent remains the wrong one. So I was wondering if there's a way to completely erase the GeoTIFF header file, then assigning the CRS and obtaining the correct bounding box.


ArcServer 10.1 - Publishing C# Executable as a Geoprocessing Service

I am trying to publish an arcobjects C# executable as a gpservice. We did this in 10.0 by adding it to a toolbox and hitting publish. Using ArcCatalog in 10.1 you must first run the script before you can 'Share as a Geoprocessing Service'. I've run the GP tool successfully and have tried both 'Publish to Server' and 'Save as a Service Definition' file. It won't let me go any further though. It comes back with Script Syntax Error Line: 1 - which leads me to believe it is trying to parse the executable as a python script. Does anyone know how to overcome this? And better yet is there any way to publish a GP service without running it first?


Multiple Google fusion table layers with queries using javascript

I am making a web mapping application using Google fusion tables and JavaScript. Earlier I had only one Layer on it, but now I have to put another layer. Both the layers have bunch of queries. I am following the online examples but it is not working. Below is my initial code before applying any queries. The first layer is coming but as soon as i put the function for second layer, the first layer disappears. Also the query result is produced as a JSON.               var tableid_1 = 3775xxx;       var tableid_2 = 4313xxx;      var layer_1, layer_2;     var queryUrlHead = 'http://www.google.com/fusiontables/api/query?sql=';     var queryUrlTail = '&jsonCallback=?';     var zoom = 7;     var latlng = new google.maps.LatLng(3xy.7996, -11x.1668);          function initialize() {               var myOptions = {         zoom : zoom,         center : latlng,         mapTypeId : google.maps.MapTypeId.TERRAIN,         mapTypeControl: true,         mapTypeControlOptions: {         style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,         position: google.maps.ControlPosition.TOP_LEFT     },         scaleControl: true,         scaleControlOptions: {         position: google.maps.ControlPosition.BOTTOM_LEFT     },     };          var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);                   // first layer//               layer_1 = new google.maps.FusionTablesLayer(tableid_1);          layer_1.setMap(map);     layer_1.enableMapTips({             select: "'Name'",             from: tableid_1,             geometryColumn: 'Location',              suppressMapTips: false,              delay: 50,             tolerance: 5     });         addListeners();               layer_1.setQuery(qry);          var col_list = 'Name';          if(order_list && order_list !== 'Name') {         query += " ORDER BY " + order_list;     }          var queryurl = encodeURI(queryUrlHead + qry + queryUrlTail);                              $.ajax({         type : "GET",         url : queryurl,         dataType : "jsonp",         success : dataHandlerCallback,         error : function() {             alert("AJAX ERROR for " + queryurl);         }     });     }


How to get travel time and link used from osm2po http service

I used osm2po to get shortest paths but I would like to get travel time and osm links ids used in the path. Is it possible? Here is the osm2po service url format I use (this is an example): http://localhost:8888/Osm2poService?cmd=fr&source=26915&target=106044&findShortestPath=false&ignoreRestrictions=false&ignoreOneWays=false&routerClassId=0&heuristicFactor=0.0&maxCost=0.0&debugExpansion=false&key=Key&value=Value&tsp= Thanks! Leo Comment: Well, I just found I can add format=geojson to the query string and I can then get the line strings associated with the path. Perfect. I then just need to match the id in the db with the travel speed.


GIS application for sewer design...how is it done?

I need to know from the very beginning about how I start.


Transform ssf to shp

Good Morning Do you know a free program that transform *.ssf to *.shp files? Thanks Eduardo Abade


Read (old?) Trimble files into ArcGIS?

I have a number of files that I believe are from a Trimble GPS. The file extensions are: .cor .gic .gip .gis .giw .gix .obs .obx .SSF I need to be able to map the data in ArcGIS (these are old files and no one really knows what the heck they are!). I haven't been able to figure out how these files work together (the .SSF is a compiled version of the others, maybe?). And I don't know if I need to look into Pathfinder Office, or the GPSAnalyst extension or.... So, assume I'm an idiot (easily done), and give me an idea of where to start and where to go from there? THANKS!


How to integrate Openstreetmap in Rails3.2 using Mongodb?

I'm planning to use Open street map in my Rails app to track locations, Can any one guide how to integrate Open street map with Rails 3.2, using MongoDB. Thanks


What does 1:10m mean related to map resolution?

On Natural Earth they offer maps at various resolutions. What does 1:10,000,000 mean? Does it translate to the number of points per square meter or mile?


What do I need in order to show offline map (tile cached based) of area from OSM using Openlayers?

I want to make an offline map with certain zoom levels of an area from OSM (preferably keeping the styles of OSM). Client will use OpenLayers , If needed I can install Geoserver/Mapserver and MS-SQL Express. What will be the easiest way to such a thing ? Do I need to use XYS layer type or local WMS? How do I automatically cache the area I need ?


What is the unit of measurement for scale?

Maybe this is standard across mapping engines, but in MapGuide if I set the scale to 7 million I can see about half the world. At about 4 million I can see a continent. What unit of measurement could this scale possibly be in?


NameError: name 'Con' is not defined

I have 365 rasters with the same extent, and I am trying to sum them together by month. I have the script below, which was working until I added the line `out1 = Con(IsNull(raster), 0, raster)` which is supposed to get rid of any nodata cells in each raster I am processing. Now my script keeps raising the exception: `NameError: name 'Con' is not defined.` I am using the Con function exactly as it is used in all of the ArcGIS help documentations, so I understand why it doesn't recognize `Con`. Anyone have any ideas as to what is causing this error? My script is below.               #script to create scaled habitat maps          #import  modules     import arcpy          #check out spatial analyst extension     if arcpy.CheckExtension("Spatial") == "Available":         arcpy.CheckOutExtension("Spatial")     else:         arcpy.AddError("Spatial Analyst extension is unavailable. Please check to see if you have the Spatial Analyst License.")          from arcpy import env     rasters = "Z:/sharks/Models/Summer2013/RF/ALL/SB_RF/NSMPpresRFPdh/AR_NSMPpresRFPdh/outputRasters"     env.workspace = rasters     listRasters = arcpy.ListRasters()     listRasters.sort()     listRasters     janRasters = listRasters[0:30]     febRasters = listRasters[31:58]     marRasters = listRasters[59:89]     aprRasters = listRasters[90:119]     mayRasters = listRasters[120:150]     junRasters = listRasters[151:180]     julRasters = listRasters[181:211]     augRasters = listRasters[212:242]     sepRasters = listRasters[243:272]     octRasters = listRasters[273:303]     novRasters = listRasters[304:333]     decRasters = listRasters[334:364]          rasterList = [janRasters, febRasters, marRasters, aprRasters, mayRasters, junRasters, julRasters, augRasters, sepRasters, octRasters, novRasters, decRasters]     nameList = ["janHabitat.img", "febHabitat.img", "marHabitat.img", "aprHabitat.img", "mayHabitat.img", "junHabitat.img", "julHabitat.img", "augHabitat.img", "sepHabitat.img", "octHabitat.img", "novHabitat.img", "decHabitat.img"]          counter = 0                 for list in rasterList:         i = 0         print ("processing list: %s" % (list,))         for raster in list:             print ("processing raster: %s" %(raster,))             #convert nodata to zero             out1 = Con(IsNull(raster), 0, raster)                  #sum rasters together             if i == 0:                 outSUM = arcpy.Raster(raster)                 i += 1             else:                 outSUM = outSUM + raster                 i += 1              #save final output to the current workspace         outSUM.save("Z:/sharks/Models/Summer2013/RF/ALL/SB_RF/NSMPpresRFPdh/AR_NSMPpresRFPdh/monthlyHabitat/" + nameList[counter])         counter +=1


Change precision of Real column

I have a sqllite table which has columns to hold the hectares and acres of polygons but I only want to have two digits after the decimal point - when calculated they have 14! How do I change this so only 2 appear?


GDAL_TRANSLATE Assumes Picture is Orientated North?

I used gdal_translate to change a jpeg to a geotiff. Attempting to use gdalwarp to create a mosaic I found the images skewed and this lead me to the observation in the title of the question. Below I've posted the line I used to translate and gdalinfo on the new image. Notice that the upper left and lower left longitudes are the same (-76.4303686) and the upper right and upper left latitudes are the same (38.1480727). Is this a flaw/bug or am I doing something wrong?               C:\Users\path\to'Desktop>gdal_translate -a_ullr -76.43036800559511 38.14807271147     146 -76.43183999600483 38.148231283935985 IMG028.jpg img28.tif     Input file size is 400, 267     0...10...20...30...40...50...60...70...80...90...100 - done.          C:\Users\path\to\Desktop>gdalinfo img28.tif     Driver: GTiff/GeoTIFF     Files: img28.tif     Size is 400, 267     Coordinate System is `'     Origin = (-76.430368005595113,38.148072711471457)     Pixel Size = (-0.000003679976024,0.000000593904362)     Metadata:       EXIF_BitsPerSample=8 8 8       EXIF_ColorSpace=65535       EXIF_DateTime=2013:11:02 15:13:42       EXIF_ExifVersion=0221       EXIF_Orientation=1       EXIF_PhotometricInterpretation=2       EXIF_PixelXDimension=400       EXIF_PixelYDimension=267       EXIF_ResolutionUnit=2       EXIF_SamplesPerPixel=3       EXIF_Software=Adobe Photoshop CC (Windows)       EXIF_XResolution=(72)       EXIF_YResolution=(72)     Image Structure Metadata:       INTERLEAVE=PIXEL     Corner Coordinates:     Upper Left  ( -76.4303680,  38.1480727)     Lower Left  ( -76.4303680,  38.1482313)     Upper Right ( -76.4318400,  38.1480727)     Lower Right ( -76.4318400,  38.1482313)     Center      ( -76.4311040,  38.1481520)     Band 1 Block=400x6 Type=Byte, ColorInterp=Red     Band 2 Block=400x6 Type=Byte, ColorInterp=Green     Band 3 Block=400x6 Type=Byte, ColorInterp=Blue      I appreciate help. I'm new to GIS and really programming in general. Simple explanations would be helpful and links to where I could have found the solution myself [EDIT] Thank you for the responses. The pictures were taken from a high altitude and the camera was pointed directly below. The picture is effectively a rectangle. I do not have 'world files.' That being said, I do have information that was read from a GPS unit. The information is: latitude, longitude, altitude, heading (degrees clockwise from North). These co- ordinates are assumed to be at the exact center of the picture. The hard-coded ulx uly, lrx, lry values are a result of trigonometry. They were intended to represent the latitude and longitude of the upper-left and lower-right corners of the picture (which is what I understood GDAL wanted). Thus it might totally be possible that the upper-left corner of the picture is actually more southward than the lower right (i.e. the picture is upside down). I thought GDAL automatically reads the size of the image and assigns proper bounds for the upper right and lower left corners. I read over the translate docs again and there seem to be no parameters with which I can tell GDAL to read data about orientation using a 'world file.' What methods are available to factor in the rotation of the image? Rather: can someone provide easy-to-read links on how to use gdal_translate properly? Ones that are made for newbies. In particular, multiple methods of factoring in image rotation would be preferred. I do not want to create world files. It would be good if I could somehow factor in rotation using command line flags or something. Additionally, I'm unclear about what a projection is. I know 'projection' is like assigning parameters for what a pixel means in meters and what latitude and longitude means. But something like this is not helpful:               -a_srs srs_def:     Override the projection for the output file. The srs_def may be any of the usual GDAL/OGR forms, complete WKT, PROJ.4, EPSG:n or a file containing the WKT.      Thank you a lot! I will continue to work on projection because I have a few leads but this 'world file' business and image rotation I do not even know where to start. I appreciate it a lot!


Thematic map with points QGIS

I would like know how can I make a thematic map (soybean production) with density points. In this case the points are randomly plotted in a municipality area. Please, see an example in the image: ![Brazilian Soy Prod.](http://i.stack.imgur.com/0m8Lq.png)


How Oracle is related with GIS (Professional wise)

I am GIS B.Tech Graduate. In the aiming of becoming GIS Developer .I temporairly changed my profession from GIS Analyst to Software Engineer. But what I got in this software company is oracle (not .net or Python). I want know with gaining oracle experience how Can I comeback To GIS Domain any suggestions?


What are Esri's new "ArcGIS for Professionals" and "ArcGIS Pro"?

After looking through all the stuff that was released or talked about at the Esri UC I am still genuinely confused by what ArcGIS for Professionals is. I will admit that it looks pretty cool, and has some sweet features, but I just do not know how it is different from ArcMap or ArcGIS Online. Does anybody have any clearer answers beyond the flashy video and homepage?


Add bunch of numbered locations?

To avoid carrying books and optimize things while traveling, I like to build a Google Map with sights and cafés/restaurants. I usually print it on paper or keep a PDF in my phone so that I don't pay for a data connection. But single Google Map is unable to take a bunch of addresses as input and doesn't offer a way to number locations, it's very time-consuming. I had to find and download numbered thumbtacks. Here's an example of Prague I started today. Are there add-on's to either Google Maps or OpenStreetMap that provide a better solution? Ideally, I could just paste a list of addresses, it would add all the locations on a map, each with a number, and let me re-order the locations easily. Thank you. * * * Edit: Google Maps has the option of importing date from a KML, KMZ, or GeoRSS file. Could this be the solution?


Openlayers renderer in IE8 - Labels not visible

I copied the source code of http://openlayers.org/dev/examples/vector- features-with-text.html. This url works just fine in IE8. I put the html page as it is in the webfolder in our network. I opened this page from the local site But what found was labels were not visible in IE but in chrome they seemed just fine. What should I do to make it work in IE also? WHat is preventing the labels to render in IE but the same code works from the public site above. Ifyou right click and see the code you can see the code as follows:                renderer = (renderer) ? [renderer] : OpenLayers.Layer.Vector.prototype.renderers;                  var vectorLayer = new OpenLayers.Layer.Vector("Simple Geometry", {                 styleMap: new OpenLayers.StyleMap({'default':{                     strokeColor: "#00FF00",                     strokeOpacity: 1,                     strokeWidth: 3,                     fillColor: "#FF5500",                     fillOpacity: 0.5,                     pointRadius: 6,                     pointerEvents: "visiblePainted",                     // label with \n linebreaks                     label : "name: ${name}\n\nage: ${age}",                          fontColor: "${favColor}",                     fontSize: "12px",                     fontFamily: "Courier New, monospace",                     fontWeight: "bold",                     labelAlign: "${align}",                     labelXOffset: "${xOffset}",                     labelYOffset: "${yOffset}",                     labelOutlineColor: "white",                     labelOutlineWidth: 3                 }}),                 renderers: renderer             });      Thanks Vijay


ArcGIS 10 Network Analyst Service Area Problem/Peculiarity with Solving

I am having a problem when solving some of my service areas. I am loading the locations from a point feature class, and they are all located. The majority of them return a service area that is appropriate (7 minute breaks, double checked with solving for routes), but a handful of them return something strange. The problem is that there are some areas of the specific service areas that are wildly inaccurate, and there is no way that it is a 7 minute distance, which I also checked. I have attached a picture of the problem, and I'm assuming that it has something to do with my network, but I have no idea what. Any help/ideas would be greatly appreciated. The network is a walking network that was manually created, and I am using ArcGIS 10. Thanks, Eric ![attached](http://i.stack.imgur.com/Va7BP.jpg)


How to separate raster bands in model builder?

I have a simple model that iterates through folders to collect imagery, mosaics them and clips the mosaic to a study area boundary. I need to produce an NDVI from the clipped 4-band mosaic "sa11_4band.tif" by incorporating the raster calculator into the model. The problem I am encountering is that the individual bands do not appear in the raster calculator when I incorporate the raster calculator tool. How should I separate the raster bands from "sa11_4band.tif" in order to perform the necessary calculation in the raster calculator?:               Float("sa11_4band.tif - Band_4"-"sa11_4band.tif - Band_3")/Float("sa11_4band.tif - Band_4" + "sa11_4band.tif - Band_3")       ![enter image description here](http://i.stack.imgur.com/AU0Qd.jpg)


How to visualize the vertices of a graph in QGIS?

I tried to visualize the graph generated by osm2po and rendered that graph in qgis. Now what I am trying to do is plot the vertices in the graph. So that I can visually see where the nodes/vertices are. I have attached a screenshot of the visualization I have up to now. ![enter image description here](http://i.stack.imgur.com/iFrCr.png) I want to actually see the nodes in this I followed the suggestion as given by underdark. However, I could see that the number of nodes and edges is less than that in the database. In the database the number of nodes = 32 and the number of edges = 39. However in my case it is 31 nodes only and 38 edges only. What could be the reason? ![enter image description here](http://i.stack.imgur.com/V1eFO.png)


How to count consecutive pixel values for a set of rasters?

All, I'm using ArcGIS 10 with Spatial Analyst. I have a set of rasters (8 in total) that only every contain a 1 or a 0 for each cell. Each raster represents a different years worth of data. For arguments sake year 1 to year 8. I can add all the rasters together which will give me a final grid with values ranging from 0 to 8. An 8 indicating that the cell was constantly 1 for the set of rasters (all years). I would like to find out for each cell the longest consecutive number of 1's. So for example the total grid may record for a single cell a value of say 5 but over the 8 grids that cell has the largest consecutive number of 1's equal to 3. Or another way of expressing this is for 3 years that cell was a 1 then it started to oscillate between zeros and ones. My raster processing skills is not as hot as my vector processing skill and I have had a good look at the ESRI help file but I can't figure out how one would achieve this using off the shelf geo-processing tools? Any ideas? Many thanks Duncan


JSAPI - how to add a graphic on top of another graphic in the same layer?

I have a graphics layer and I'd like to add a graphic _behind_ the existing graphics. I've come up with this:               graphicsLayer.add(overlay.graphic);     graphicsLayer.graphics.unshift(graphicsLayer.graphics.pop());      But I have to pan the markers off the screen and then pan them back into view before the 'unshift'-ed graphics display correctly. I've tried calling refresh without any affect:               graphicsLayer.refresh();      How can this be done without introducing a second graphics layer?


How can I make the topology checker plugin ignore very tiny errors?

I'm a QGIS2.0 user. Topology checkers is a very valuable for me as a data creator. I use this plugin for checking data quality. But, this plugin finds too much errors include very, very tiny errors. I have tried to set a "tolerance" for the rule but it does not work well. Please tell me how to use this function.


A lot of pointers to load on map-A better solution

I have to project a lot of points present in my Database say more than 100000. I heard that using geoserver is a better solution as it can render any number of points and from http://swingley.appspot.com/maps/olpts it is almost confirmed that I cannot use the normal code to project many points. I recently heard about cluster strategy that is present in OpenLayers and I think it can help me but I am not sure. Can anyone help me about the better solution of these two GEOSERVER or CLUSTER strategy and reasons why one is preferred over the other? Remember I have to display many layers on the map.


How to paste pictures into data frame?

I have a polygon feature class and I want to trace (select with a polygon) a picture that is solely comprised of a couple of interlocking letters. In ArcMap when I would do this I would simply drag the picture into the data frame and I could adjust the sized and position of it, trace, export, delete the picture and have a brand new layer in the shape that I wanted. I don't see a way to do this in QGIS, when I drag a photo in I am then prompted to define the new layer's coordinate system. It doesn't seem to recognize that it is only a picture. Anyone know how I can simply drag in a picture to QGIS to trace it?


Join a CSV file to shapefile using gdal/ogr?

I have a shapefile with several attributes, for example `YEAR`, `COUNTY`, and `AREA`. I also have a CSV file with more fields that I want in the shapefile, such as `POPULATION`. Both the shapefile and the CSV file have a field `GISJOIN`. I know how to do a join in QGIS. But how can I make a permanent join and write to a shapefile using `ogr2ogr` or one of the other tools in GDAL/OGR?


Repository of ArcView 3.x Avenue commands/methods/general information?

The time has come for my great ArcGIS 10 skills to be put to the test... but we don't have readily available licenses for a lot of functionality that is exposed through ArcView 3.x's Avenue scripts. One pertinent example is the absolutely astounding [Shape].Flip functionality in the Field Calculation dialog that ArcView has that is only available to Medium-High license levels in ArcGIS 10. Long story short, I've decided it is worth knowing at least the basics of working with ArcView 3.x and Avenue. Where should I look? P.S. I can't view the help because my OS cannot read .hlp files (yet). This will be remedied someday over the rainbow, so any help is greatly appreciated-- nothing will be too basic, more than likely.


Attributive WFS styling

I have a local Geoserver connected to a PostGIS database and a table with an attribute field called "style" which is of data type integer. On the OpenLayers preview of the Geoserver the data is shown and accessible. The web application I load via an local Apache (XAMPP) server. The same policy origin is considered through an cgi proxy script which is linked within the script.js. with this code line "OpenLayers.ProxyHost = "/cgi- bin/proxy.cgi?url=";". In the proxy script I added localhost for the Apache server and localhost:8080 for the Geoserver. The problem is that i want to style a WFS over the attribute style, and every style: 1, 2, 3, ... should get an own color and a own checkbox. For now only the default rule "rule_3" works and I don't know why. Here is the part of the source code:               // Marker Clustering for WFS Layer     var strat = [         new OpenLayers.Strategy.BBOX(),         new OpenLayers.Strategy.AnimatedCluster({             distance: 15,             animationMethod: OpenLayers.Easing.Expo.easeOut,             animationDuration: 10         })         // new OpenLayers.Strategy.Cluster()     ];          var style = new OpenLayers.Style();          var rule_1 = new OpenLayers.Rule({         filter : new OpenLayers.Filter.Comparison({             type : OpenLayers.Filter.Comparison.EQUAL_TO,             property : 'style',             value : 1         }),         symbolizer : {             fillColor : '#ffffff'         }     });          var rule_2 = new OpenLayers.Rule({         filter : new OpenLayers.Filter.Comparison({             type : OpenLayers.Filter.Comparison.EQUAL_TO,             property : 'style',             value : 2         }),         symbolizer : {             fillColor : '#ff00ff'         }     });          var rule_3 = new OpenLayers.Rule({         symbolizer : {             fillColor : '#ff6600'         }     });          style.addRules([rule_1, rule_2, rule_3]);                var wfsLayer = new OpenLayers.Layer.Vector(         'Christmas Traditions',         {             strategies: strat,             styleMap: new OpenLayers.StyleMap(style),             protocol: new OpenLayers.Protocol.WFS({                 version: '1.0.0',                 url: 'http://localhost:8080/geoserver/wfs',                 featurePrefix: 'cite',                 featureType: [                     'op_god_jul_fts',                     'op_vrolij_kerstfeest_fts'                 ],                 featureNS: 'http://www.opengeospatial.net/cite',                 //propertyName: ['txt', 'style'],                 srsName: 'EPSG:4326',                 geometryName: 'coords'         }),         isBaseLayer: false,         visibility: true,         });          // Add layers to map object     map.addLayers([         cloudmadeMidnightCommander,         stamenToner,         mapQuestAerials,         wfsLayer     ]);      Current all points have the same color of style rule_3. The dots over Belgium and Netherlands should have an other color. The table "op_god_jul_fts" should have the style of rule_1 and the table "op_vrolij_kerstfeest_fts" should have the style of rule_2. Perhaps anybody can help me. Thank you and kindly regards!


Habitat fragmentation tool error

I am trying to calculate the habitat fragmentation of a forested region in Africa in order to protect the areas less fragmented. I have used the tool "Landscape Fragmentation Tool V2 requiring Spatial Analyst" but I have an error during its execution. Could you recommended me another tool to calculate fragmentation of habitats using arcgis 10.1? The input that I used was a land cover map with 1 and 2 data, and the edge width was 50. This is the error:                   Executing: Landscape_Fragmentation_Tool Bool_fragm 50 C:\CW2\project_2 fragmentation     Start Time: Mon May 12 22:51:18 2014     Running script Landscape_Fragmentation_Tool...          OUTPUT DATASET NAME IS:              C:\CW2\project_2\fragmentation.img          DATA EXTRACTED FROM LAND COVER     EDGE FRAGMENTATION IDENTIFIED     INTERIOR, PATCH, AND PERFORATED FRAGMENTATION IDENTIFIED     CATEGORIZING CORE FOREST PATCHES...       File "C:\arcgis_extras\Landscape_Fragmentation_SA\LFT_SA.py", line 254, in <module>         gp.RegionGroup_sa("core1_", core_grp, "EIGHT", "WITHIN")          <class 'arcgisscripting.ExecuteError'>: ERROR 010213: Error in reading raster c:\fragdata\core1_.     ERROR 010067: Error in executing grid expression.     Failed to execute (RegionGroup).          Completed script Landscape_Fragmentation_Tool...     Failed to execute (Landscape_Fragmentation_Tool).     Failed at Mon May 12 23:33:04 2014 (Elapsed Time: 41 minutes 46 seconds)      Thanks! UPDATE: Here you can find more lines in case you have some idea:                #-------------------------------------------------------------------     # CLASSIFY CORE FOREST BASED ON PATCH SIZE               gp.workspace = TempWS          gp.AddMessage("CATEGORIZING CORE FOREST PATCHES...")     print "CATEGORIZING CORE FOREST PATCHES..."          gp.Reclassify_sa (fragMap2_f, "Value", "4 1", "core1_", "NODATA")          # region group core class...     core_grp = TempWS + "\\core_grp.img"     gp.RegionGroup_sa("core1_", core_grp, "EIGHT", "WITHIN") <-- The error is here          # convert core groups to txt file...     coreGrpFile = "%s\\coreGrpFile.txt" % TempWS     gp.RasterToASCII_conversion(core_grp, coreGrpFile)          # convert 4 class frag map to txt file...     fragMap_4c = "%s\\fragMap_4c.txt" % TempWS     gp.RasterToASCII_conversion(fragMap2_f, fragMap_4c)               cur = gp.SearchCursor(core_grp)     row = cur.next()          remap_dct = {}