texts: How to set Zoom Level based on Overlays in Ordnance Survey Map?

texts:
I am using the Ordnance map as a backdrop in my website. when overlays the WMS from Geoserver, I am unable to increase the zoom level. Please see my code and kindly suggest it.

 var options = {
                maxResolution: 0.55804443359375,
                projection: "EPSG:27700",
                units: 'm'
            };
            map = new OpenSpace.Map('map', options);

// Define or get the vector layer to be used
var vlayer = osMap.getVectorLayer();
var mlayer = osMap.getMarkerLayer();
vlayer.displayInLayerSwitcher = false;
mlayer.displayInLayerSwitcher = false;

// setup tiled layer
format = 'image/png';
var tiled = new OpenLayers.Layer.WMS(
                "Oxford_Example",
                "http://192.168.0.126:8080/geoserver/cite/wms",
                {
                    transparent: 'true',
                    LAYERS: 'cite:Oxford_ExampleCapture',
                    STYLES: '',
                    format: format,
                    tiled: true,
                    tilesOrigin: osMap.maxExtent.left + ',' + osMap.maxExtent.bottom
                },
                {
                    buffer: 0,
                    displayOutsideMaxExtent: true,
                    singleTile: true,
                    ratio: 1,
                    isBaseLayer: false,
                    yx: { 'EPSG:27700': false }
                }
            );

osMap.addLayers([tiled]);

//Show Co-Ordinate on mouse over
osMap.addControl(new OpenLayers.Control.MousePosition());

//OverViewMap
var control = new OpenSpace.Control.OverviewMap();
osMap.addControl(control);
control.maximizeControl();

//ScaleBar
osMap.addControl(new OpenLayers.Control.ScaleLine({ displayClass: 'olControlScaleLine'   }));
//    osMap.addControl(new OpenLayers.Control.Scale({ displayClass: 'olControlScale' }));

//Layer Switcher
//    var layerSwitch = new OpenLayers.Control.LayerSwitcher();
var layerSwitch = new OpenLayers.Control.LayerSwitcher({
    div: OpenLayers.Util.getElement('layerswitcher')
});
osMap.addControl(layerSwitch)

But i can zoom in this level only. I am unable to the particular feature. See the below image:


texts: Changing QGIS system SVG path with PyQGIS

texts:
I am trying to change the SVG path with Python but I couldn't find any document which explains how to do this.
This is what I want to do
I Added SVG symbols to my plugin in a specific folder.
When the plugin initiates I want to check SVG paths in system/ option.
if the path does not exist then I want to add it.

I tried the following code in python console but It does Nothing

 QSettings().setValue(u'/qgis/system/Qgis/system/svg_paths', u'C:\1234m')

it gives no error but It does nothing.


texts: Aggregating a raster to fit a polygon grid

texts:
I am working at the scale of 10 square km grid cells for the UK, and have a polygon layer of the Ordnance Survey 10k grid cells in ArcGIS.

I have another layer of the human footprint index, also for the entire UK, that I am using to stratify my data.

However, the resolution of this human footprint index is much greater than that of the 10k grid cells, so I want to aggregate the cells, such that I have a human footprint index value for each 10 sqkm cell.

When I try to do this, however, the squares and grid do not line up - as can be seen in the pictures.

They are in the same projection.

Is there any way to aggregate a layer to the confines of a polygon grid?

Any help would be very much appreciated!

Images here:


texts: i am creating a java program that will receive data from GPS tracker device and will store it in MySQL. for this purpose i need to create a GPRS connection for receiving data. Can anyone help me how to create GPRS connection in Java.


texts:
I am trying to load GeoJSON in OpenLayers, however, the polygon isn't visible on the map. What am I doing wrong?

<!doctype html>

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/css/ol.css" type="text/css">

    <title>Gminy</title>


texts:
I'm trying to add sub-menu items to a menu that linked to a toolbar icon. It's probably best to show what result I'm getting currently, then reference the code:

The code is coming from a plugin class:

class SandBox2:

def __init__(self, iface):
    self.iface = iface
    self.plugin_dir = os.path.dirname(os.path.realpath(__file__))
    self.actions = []

def initGui(self):
    self.toolbar = self.iface.addToolBar("Sandbox2")
    self.toolbar.setObjectName("Sandbox2")

    self.SetupSubMenu = QAction((QIcon("C:/Users/Rudy/.qgis2/python/plugins/arcLensStandard/icons/new.png")), "Sub-Item 1-1",self.iface.mainWindow())
    self.submenu_11 = QMenu(self.iface.mainWindow())
    self.submenu_11.addAction(self.SetupSubMenu)
    self.SetupSubMenu.triggered.connect(self.runMsg1)

    self.SetupMainMenuItem = QAction((QIcon("C:/Users/Rudy/.qgis2/python/plugins/arcLensStandard/icons/item_one.png")), "First Menu Item", self.iface.mainWindow())
    self.Menu1 = QMenu(self.iface.mainWindow())
    self.Menu1.addAction(self.SetupMainMenuItem)
    self.Menu1.addMenu(self.submenu_11)

    self.toolButton = QToolButton()
    self.toolButton.setIcon(QIcon("C:/Users/Rudy/.qgis2/python/plugins/arcLensStandard/icons/adddata.png"))
    self.toolButton.setMenu(self.Menu1)
    self.toolButton.setPopupMode(QToolButton.InstantPopup)
    self.toolbar.addWidget(self.toolButton)

def runMsg1(self):
    QMessageBox.information(self.iface.mainWindow(), "Message",
        "Sub-Item 1-1 Message", QMessageBox.Ok)

What I want to see is the right-facing caret symbol on the same line as the "First Menu Item" string, instead of appearing on a blank line after the string. The statement that's adding the sub-menu is:

self.Menu1.addMenu(self.submenu_11)

and that's where the blank line gets inserted (apparently).


texts: QGIS: Jump to next feature (like in Atlas)

texts:
I would like to jump to next feature in my attribute table. I know this is possible with the "print composer" using "atlas".

Is there any possibility to jump to the next feature in my attribute table using the standard QGIS canvas?


texts: Is it possible to calculate the route when source and destination having same junction using A* algorithm?

texts: I am using A* Algorithm to calculate the shortest path. The route was calculated based on the junction. Shortest route was calculated when there was two or more junction in between source and destination, but the route was not calculated when source and destination having same junction or without having junction.


texts: Point placement between midpoint and endpoint

texts:
I have a line with a,

Mid Point
End Point

I'm trying to return a coordinate that's LENGTH away from Mid point (on the same line) and between end and mid (oppose to between Midpoint and the Startpoint).

private static Coordinate direction(Coordinate end, Coordinate mid){
   double dy1 = (mid.y + LENGTH);
   double dx1 = (mid.x + LENGTH);

   double dy2 = (mid.y - LENGTH);
   double dx2 = (mid.x - LENGTH);

   GeodesicData g1 = Geodesic.WGS84.Inverse(end.getY(), end.getX(), dy1, dx1);
   GeodesicData g2 = Geodesic.WGS84.Inverse(end.getY(), end.getX(), dy2, dx2);

   if(g2.s12 > g1.s12)
   {
      return new Coordinate(dx1, dy1);
   }
   else
   {
      return new Coordinate(dx2, dy2);
   }
}

The problem is when mid.x / mid.y are around 0 I get really weird behavior from the lat/lon arithmetic.  I think that's the problem, not sure how to fix it.


texts: Creating new lines based on another line feature and point feature using QGIS?

texts:
I have line layer (roads) and point layer (milestones) and I need to create a new line layer based on roads layer, where the start and the end points will be milestone points.

Can you advise me some tool or script to create it?

when I try use in Qgis Split lines at points I get this:


texts: Calculating Grading/Land levelling volume using ArcGIS

texts:
I have recently been given a task from my professor to calculate Grading/land levelling volume of an airport using ArcGIS (cut/fill volume of the land). However, this is the first time for me to approach this programme so there are a few problems. Also, I have looked around on the Internet to seek for the answers but they did not seem to be applicable in my case.

This is a brief introduction of my case:

I have been given an image containing contours (Nothing more than contour and it is an image, TIF file in specific).
What I need to do is to calculate the volume of lands that need to be cut or filled in order to create a flat surface for an airport.

And then my approach:

Georeferencing: I used another programme to give the image some coordinates and made it be able to be opened in ArcGIS.
Digitising: I created a shapefile, digitised the map by sketching following the contours, created raster and TIN.
Calculating: There are two ways that I found on the Internet: Using Cut/Fill or Surface volume.

Problems:

ArcGIS provides a tool to calculate the difference between a surface and a polygon. However, the flat surface that I need to level to has inclination, which means the elevation in the polygon changes in different points. The same problem happens when using Surface volume to calculate the volume Above/Below an elevation.

My questions are:

Is it possible to do the grading/levelling that I described above?
Am I going in the right way in calculating the volume?
If yes, please show me what I have to do or what I have done wrongly so I can learn from my mistake.


texts: Why use GeoServer or Tegola to generate vector tiles from PostGIS rather than ST_AsMVT?

texts:
I don't have much experience generating vector tiles dynamically. Instead I use Tippecanoe.

I'm looking at generating tiles from PostGIS and see at least three options:

PostGIS + Geoserver (with vector tiles extension)
PostGIS + Tegola
PostGIS, using its own native ST_AsMVT function.

So: What is the benefit of using an additional layer on top of PostGIS rather than its own direct support for vector tile generation?


texts: British National Grid to KML results in offset polygons

texts:
I have a shapefile of English wards from ONS.

It is similar to the files available here:
http://www.ons.gov.uk/ons/guide-method/geography/products/census/spatial/2011/index.html
except I had to explicitly ask them for ward shapes, for which they have just released census data.

They sent me a shapefile, and I would like a KML.  The shapefile lines up perfectly (I use MapWindow GIS to view it) with The other shapefiles in that set, suggesting there is nothing wrong with the coordinates of this one file.

When I convert it to KML, all the coordinates are offset.  I use Google Earth to view it, and it does not line up with the other KML files (for example MSOA).

In both cases I am looking at the clipped to the coastline versions.  I am specifically looking at Lambeth, and I can see that the border does not line up with the Thames and is in land too far east and and possibly a bit too far south.

To convert from shapefile to KML I have tried PostGIS, a Shape2Earth plugin for MapWindow GIS and an application called shp2kml.  In all cases I get the same result.

I have tried converting the Shapefile from BNG to WGS84 then converting that to KML. I also tried converting to ETRS89, and then to WGS84 as suggested in one of the answers here:

Converting from British National Grid (27700) to WGS84 (4326) to Web Mercator (102100)

My prj file looks like this:

PROJCS["British_National_Grid",
GEOGCS["GCS_OSGB_1936",
    DATUM["D_OSGB_1936",
        SPHEROID["Airy_1830",6377563.396,299.3249646]
    ],
    PRIMEM["Greenwich",0.0],
    UNIT["Degree",0.0174532925199433]
],
PROJECTION["Transverse_Mercator"],
PARAMETER["False_Easting",400000.0],
PARAMETER["False_Northing",-100000.0],
PARAMETER["Central_Meridian",-2.0],
PARAMETER["Scale_Factor",0.999601272],
PARAMETER["Latitude_Of_Origin",49.0],
UNIT["Meter",1.0]
]

Any idea what I am doing wrong?


texts: AWS sentinel 2 duplicate entry difference

texts:
can anybody  explain what main difference between two almost identical directories:

http://sentinel-s2-l1c.s3-website.eu-central-1.amazonaws.com/#tiles/22/K/EC/2017/10/10/0/
http://sentinel-s2-l1c.s3-website.eu-central-1.amazonaws.com/#tiles/22/K/EC/2017/10/10/1/

These directories almost identical, but one contains preview and another does not.


texts: Do transfer edges add to the distance cost of a route?

texts: Transfer edges are commonly used in a network dataset to carry a time cost in one direction only (either to-from or from-to). This is fine if the impedance used is time, i.e. find the route that will take the shortest time. However, if the impedance is now set to distance (find the shortest route), will the length of the transfer edges unfairly impact the length of the route?


texts: How to create a label with QGIS project path in print composer?

texts: Is there a way in the Print Composer of QGIS to create a label that will automatically update the path of the QGIS project?


texts: Can I extract x and y co-ordinates that represent presence/absence using ArcGIS?

texts:
I am a complete novice where it comes to ArcGIS.

I want to be able to extract a series of presence/absence (simple 1 or 0) values in x,y format from a projected future distribution map for a bird species in Europe.

I used R (someone else's code though)to forecast the future distribution. I added the raster images from R (which were in Disc Image format originally) into ArcGIS and converted them to TIF format. I've tried converting the TIF file to a shapefile using Conversion tools -> from raster -> raster to point, but it does not preserve my presence/absence pixels. Instead, I just get a gridded map with no indication as to whether the cells were projected to be presence or absence....

... The actual presence/absence raster looks like this....

Is there a way in which I can extract the x and y co-ordinates for presence (dark blue) and absence cells (light blue) using ArcGIS?


texts: Why isn't the option to create a Network Dataset available?

texts:
I'm trying to create a network data set from a roads file (something that has worked before), but now for some reason the option to do it is not available. What could be the problem?

Why wouldn't the option to create one be available?


texts: Convert from unsigned (8 bit) integer to short integer grid

texts: I'm looking to convert a unsigned integer grid to a short integer grid for use in TauDEM. The unsigned integer grid has values ranging from 0 - 4.


texts: Allowing all QGIS workspace layers to be editable at once

texts:
I stumbled upon an odd behaviour of layers in QGIS 3.4 brought from PostGIS. The first layers I brought to the project are always editable together when clicking the Toggle Edit-button, but some of the other layers are editable only when separately selected. These layers have been brought to the project afterwards. I have tested this in 3.4.0 and 3.4.2. with Windows (as QGS and QGZ). Also when the same project was used by others in their own environment, all the layers had to be separately changed to editable. This causes problems because there are relations between the tables and you have to know what tables should be editable. How can I make all the layers editable at once?

Edit: Noticed that when the same layers are brought to a new project, they have to be clicked editable one at a time. I have used Project Generator tool to create the layers and some of the relations between the layers.


texts: Showing arrowheads at the midpoint of a line with QGIS?

texts:
This is related to the question Showing arrowheads in line end using QGIS?
But I wanted to show the arrow head at the mid-point of a line. This is because the arrow heads can be quite crowded when they meet, e.g. at a common junction (as shown below).

My question is:
Is there a way to show the arrow head at the midpoint of a line (in general a certain percentage of length in linear referencing)?
(This is with QGIS 3.2.0-Bonn)


texts: GeoServer namespace URI causing invalid WFS transaction requests

texts:
Is there any naming conventions with GeoServer's namespace URI/settings that need to be changed to allow their proper use?

I have a WFS-T that is being edited in QGIS - after a lot of issues getting 'Empty Response' I found that if I changed my workspace's URI to http://www.opengis.net/wfs then the transaction would be successful. Alternatively if I removed the xsi:schemaLocation= from the request then it is also successful.

The issue is that I can only have one workspace with that URI. If I alter it in anyway the transaction will get an empty response. Any ideas on how to get around this so I can have multiple workspaces?


texts: Reprojecting lyr file of Tiled Internet Layer created in ArcGIS Online?

texts:
I have an ArcGIS lyr file describing Tiled Internet Layer (according to Data Source tab in properties).
This file was created in ArcGIS Online by defining a new tile layer and downloading it.

Everything is OK with it except the projection. ArcGIS Online sets the projection of any newly created layer as WGS_1984_Web_Mercator_Auxiliary_Sphere which is not correct in this case.

I need to change it to a proper one.

What i've already tried:

Change projection by redefining it via toolbox (Data Management ->
Define Projection. This gave me an error in ArcMap.
Rough text edit of lyr file (by replacing a WKT-string with projection definition). This gave me an error when I'd tried to add it to a MXD (something like "Adding the selected layer file failed. Maybe it was created using a newer version of ArcGIS" which is not true)
Change projection in ArcGIS Online

Is there any way to change the projection of such layer?


texts: Spatial statistics tools : clustering analysis on raster data

texts:
I've an apparently simple problem, but i can't find a clear methodology to use.

I'm tasked to delimit "urban areas" by vector convex polygons, using the Gridded Population of the World dataset from CIESIN

This dataset provides population density values over the entire world, as a raster file.
The problem is, as you have already guessed, that the density values are very changing, and the definition of "urban" is quite relative.

I've tried to use a classical approach and calculated the slopes as if the density values were altitudes, but the slopes values were also very disparate and spatially complex, intricates.

I've looked into spatial clustering algorithms, LISA tools (Local Indocators of Spatial Association), with ArcGIS and GeoDa, but I'm quite lost among very specific tools. Some of the methods are working only on vector shapes, so a reclassification and a vectorization are needed (long computation).

Can you help me refining the set of methods and tools to use ? Thanks !


texts:
I am trying to reproject a raster image from 3857 to 27700 using QGIS 2.18.2 Las Palmas.

I loaded the OpenLayers Bing Maps Aerial (3857) and zoomed to my site, then saved the map as an image (TIFF).

I then tried to reproject the file to 27700 using Raster - Projections - Warp (Reproject)

I set my input file as the TIFF and Source CRS as 3857, the output file as a new fie and Target CRS as 27700. Resampling method "Near".

I get this error message each time:

Output driver `GMT' not recognised or does not support
direct output file creation. The following format drivers are configured
and support direct output:
GeoRaster: Oracle Spatial GeoRaster
VRT: Virtual Raster
GTiff: GeoTIFF
NITF: National Imagery Transmission Format
HFA: Erdas Imagine Images (.img)
ELAS: ELAS
MEM: In Memory Raster
BMP: MS Windows Device Independent Bitmap
PCIDSK: PCIDSK Database File
PCRaster: PCRaster Raster File
ILWIS: ILWIS Raster Map
SGI: SGI Image File Format 1.0
Leveller: Leveller heightfield
Terragen: Terragen heightfield
netCDF: Network Common Data Format
HDF4Image: HDF4 Dataset
ISIS2: USGS Astrogeology ISIS cube (Version 2)
ERS: ERMapper .ers Labelled
RMF: Raster Matrix Format
RST: Idrisi Raster A.1
INGR: Intergraph Raster
GSBG: Golden Software Binary Grid (.grd)
GS7BG: Golden Software 7 Binary Grid (.grd)
PDF: Geospatial PDF
MBTiles: MBTiles
MRF: Meta Raster Format
PNM: Portable Pixmap Format (netpbm)
PAux: PCI .aux Labelled
MFF: Vexcel MFF Raster
MFF2: Vexcel MFF2 (HKV) Raster
BT: VTP .bt (Binary Terrain) 1.3 Format
LAN: Erdas .LAN/.GIS
IDA: Image Data and Analysis
GTX: NOAA Vertical Datum .GTX
NTv2: NTv2 Datum Grid Shift
CTable2: CTable2 Datum Grid Shift
KRO: KOLOR Raw
ROI_PAC: ROI_PAC raster
ENVI: ENVI .hdr Labelled
EHdr: ESRI .hdr Labelled
ISCE: ISCE raster
ADRG: ARC Digitized Raster Graphics
SAGA: SAGA GIS Binary Grid (.sdat)
DB2ODBC: IBM DB2 Spatial Database
GPKG: GeoPackage


texts: I realize no one can give a definitive answer but is it reasonable to think the next release of ESRI JSAPI will be built on top of dojotookit 1.7?  And will be released in the next 2-3 months?  Any documention for preparing 1.6 code for the move to 1.7 that takes advantage of some of the loader features introduced in 1.6?


texts: Too many fields, cannot see them in qgis2web

texts:
I have too many fields, so they can't all be seen, is there a work around for this? see this image

As you can see the info "bleeds" over and you cannot see it, I need to reshape that as a box instead of a big rectangle or lower the font.


texts: Stopping OpenLayers Text Icon overlapping on icons

texts:
I created a style with pin SVG and text (ID of my feature) on top, but when I zoom out, the text overlaps other pins as well. Below is the code of style
style: function (feature) {
  return [new ol.style.Style({
    image: new ol.style.Icon( /** @type {olx.style.IconOptions} */ ({
      anchor: [0.5, 0.5],
      anchorXUnits: 'fraction',
      anchorYUnits: 'fraction',
      scale: 1,
      src: '/static/images/best-places/place_icon.svg'
    })),
    text: new ol.style.Text({
      text: feature.getId().toString(),
      fill: new ol.style.Fill({
        color: '#fff'
      }),
    })
  })]
}

when I'm zoomed out, it looks good

when I zoom in, the text overlaps on other features icon

I'm okay with pins getting overlapped, but I'm expecting text will also get overlapped liked the following example  https://www.trulia.com/for_sale/37.81634,37.83096,-122.28107,-122.26081_xy/16_zm/


texts: PyQGIS: error message "Cannot run algorithm wrong parameters for method" when trying to use GRASS tool

texts:
For my QGIS plugin, I'm trying to use the GRASS Tool r.neighbor. I wrote the following code which should run the tool and return the result as a raster object.

    def focalStatistics(self):
    raster = self.merge()
    outDir = os.path.join(QgsProject().instance().homePath(), "Extrapolation.tiff")
    param = {"input": raster,
             "selection": None,
             "output": outDir,
             "method": 'maximum',
             "size": 3,
             "title": 'extrapoliert',
             "weight": None,
             "gauss": None,
             "quantile": None
             }
    focalstat = processing.run('grass7:r.neighbors', param)
    rlayer = QgsRasterLayer(focalstat['output'])
    QgsProject().instance().addMapLayer(rlayer)
    return rlayer

The needed parameters I looked up from here

However, I get the following error message:

  Cannot run algorithm wrong parameters for method

I don't see the problem, the parametrs should be correct. Can someone explain the error to me


texts: Measuring large distances when all layers are in decimal degrees using QGIS?

texts: I just developed a distance matrix between various points across Canada in QGIS. The distances produced are in decimal degrees, and I would like to view them in metric. I am unsure how to do this.


texts: Adding Map templates to Layout View in ArcGIS Desktop?

texts:
I have installed ArcGIS 10.3 (on Windows 7 Pro) for desktop and it works very well. There is only e little problems: when I go to "layout view" and open "select template", the windows that appears don't contains only "My Templates" and not the the templates like ISO A Page Size, or Architectural Page Size, and so on. How can I take the Map Templates folders and bring them into the Select templates (or into Getting Started)?

My Select template:

]1

Select Template how it must be:
;


texts: Synchronizing QGIS Print Composer with map view?

texts:
I want to create a template using the "Print Composer" from my layers loaded in QGIS 2.18.7 (Las Palmas). The problem is that it seems the map element is not "synchronized" with the map view. For instance, if I zoom-in on the map view, I want the map element on the template also being automatically updated with the zoom.

Another problem related to this is that I don't know how to display the selected features in the template:

Is there any way of updating the map template automatically?


texts: Query and display thousands of features using PostGIS and WMS?

texts:
We have a feature table in PostgreSQL with PostGIS plugin, the table contains almost 200 thousand points.

In the application, we need to query features according to different conditions (for example inside an irregular polygon or rectangle or name contains some keywords) and then display all the features in the map. However, the matched result may contain thousands of points or more, so add the in the front by something like marker is unacceptable, so rendering in the server maybe a good choice.

I have thought about WMS, however I am not sure if it can fit the requirement.

I wonder if there is a better choice?


texts: How do I classify or spot a pixel, based on a specific reflectance values of the six Landsat Bands using Erdas?

texts:
I have converted the DN values to the reflectance of a Landsat image to classify the rice field by its stages. To specify the reflectance values of each stages, I have sampled the reflectance values from the converted image. However, I would like to find (spot) the rice paddies that have the same or similar reflectance values of the previous samples... How do I do this in ERDAS 9.2?

I have tried the ARCGIS but seems to not have such functions in the software.
In ERDAS I found 'Target Detection' in the 'Spectral Analysis' but it could only be used based on the library(correct me if I am wrong), not my own specific values.

Is there anyone who have tried this kind of work before? Please Help!


texts: Trying to show an OSM/Nominatim relation on an OpenLayers 3 map

texts:
I am trying to show the boundary of relation 4569(Brugge, West Flanders, Flanders, Knokke-Heist) on an OpenLayers 3 type map, like http://nominatim.openstreetmap.org . But I don't know how to proceed.

These are the things I am doing:

I am querying Overpass API with the following parameters:

data=[output:json];relation(4569); out geom; out center;

This query gives me back the information about the relation with the id of 4569 from OpenStreetMaps.

The result set from this query is multiple ways, which have their role set as outer. I am combinining these ways to create a polygon, and storing them in an array.

foreach ($geom['members'] as $_poly) {
        if ($_poly['role'] != 'outer' && $_poly['role'] != 'inner') continue;
        if ($_poly['role'] == 'outer') {
            foreach ($_poly['geometry'] as $latlon) $poly['outer'][]=array($latlon['lon'], $latlon['lat']);
        } else {
            $poly['inner'][]=array();
            foreach ($_poly['geometry'] as $latlon) $poly['inner'][count($poly['inner'])-1][]=array($latlon['lon'], $latlon['lat']);
        }
}
if ($poly['outer'][0] != $poly['outer'][count($poly['outer'])-1]) $poly['outer'][]=$poly['outer'][0];
$out['polygons']=$poly;

Afterwards, this array is sent to javascript, where I process it, and try to add a Polygon object to an OpenLayers 3 map. This is the javascript code I use. (It is wrapped in a JS prototype made by me)

Map.prototype.addPolygon = function(name, data) {

    var _coordinates=[], i;

    for (i=0; i<data.outer.length; i++ ) {
        console.log(data.outer[i]);
        _coordinates.push(ol.proj.transform(data.outer[i], 'EPSG:4326', 'EPSG:3857'));
    }

    console.log("Creating polygon", _coordinates);
    var Polygon = new ol.geom.Polygon([_coordinates]);
    var feature = new ol.Feature({
        name: name+"-outer",
        geometry: Polygon
    });
    this.polygons[name]=Polygon;

  var polyStyle = new ol.style.Style({
    fill: new ol.style.Fill({
      color: [121, 115, 251, .2]
    }),
    stroke: new ol.style.Stroke({
      color: '#051165',
      width: 2
    })
  });

  this.vectorSource.addFeature(feature);
  feature.setStyle(polyStyle);

  this.map.getView().fit(Polygon, this.map.getSize());

}

Below you will find two images, the first is the end result which I get, and the second is the end result which Nominatim gets(my desired result). If you observe, you will see that the borders of my polygon are all messy, and there are additional lines in my polygon.

My end result

Nominatim result - the desired result

What am I doing wrong? If I am doing the same thing with boundaries which are represented by a single WAY, everyting works as expected.


texts: How to use parallel parlapply for features whithin an sf object

texts:
I'm trying to create an intersection between two layers but, because of their size, st_intersection can't be done in one ony execution. I'm trying to do so spliting the process in parallel so this is what I do (this works):
library(sf)
library(mapview)
library(doParallel)

GP <- st_make_valid(st_read('./capas/GP/GP.shp'))
UP <- st_make_valid(st_read('./capas/UP/UP.shp'))

# CONFIG PARALLEL
cl <- parallel::makeCluster(detectCores(), type="FORK")
doParallel::registerDoParallel(cl)
ls <- foreach(i=1:nrow(GP)) %dopar% {
        st_intersection(GP[i,], UP) %>%
                mutate(Name = paste0(GranArea,'; ',LABEL)) %>%
                group_by(Name) %>%
                summarise()
}
stopCluster(cl)

# MERGE
GPUP <- do.call(rbind,ls)

My question is: how can I write the same process using parlapply?
Here are the layers.


texts: Getting address from coordinates on initialization of map using ArcGIS API for JavaScript 4.x

texts:
I am trying to fetch address details by lat long coordinates that are provided from DB. I am able to call locationToAddress on click. I want to do the same for on load using the coordinates.
The issue is, SpatialReference that I get on event is missing when I am trying to load on initialization. Below is the sample code,
//what I send for click event

const params = {

            location: evt.mapPoint
            };

//what I am trying to send now since I dont have click event, I am trying to send entire object of that event. statically for now of course.
          const params2 = {location: {
            extent: null,hasM: false,hasZ: false,latitude: 29.9806182045836,longitude: -92.12846434525886,m: undefined,
            spatialReference: {
              imageCoordinateSystem: null,isGeographic: false,isWGS84: false,
              isWebMercator: true,isWrappable: true,latestVcsWkid: null,latestWkid: 3857,
              vcsWkid: null,wkid: 102100,wkt: null,
            },type: "point",x: -10255186.148839561,y: 3501022.9077692255,z: undefined
          }};
          locatorTask.locationToAddress(params2)
          .then(function(response) { // Show the address found
            const address = response.address;
            showPopup(address, evt.mapPoint);
          }, function(err) { // Show no address found
            showPopup("No address found.", evt.mapPoint);
          }).catch((errr)=>{
            console.log(errr)
          });

this throws an error in locator JS before contacting server, "a.clone is not a function" I am stuck here. and can't figure out what's happening.


texts: Partially update file path for multiple layers using arcpy

texts:
I am trying to repath multiple feature classes within an mxd. The new feature classes all come from various databases and folders but the only change in the file path is in the drive name. For example C:\features\points needs to be repathed to N:\features\points

I have read over this page: http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/updatingandfixingdatasources.htm but didnt see any examples pertaining to partial name changes.

This is what I have so far but I need some advice figuring out how to update part of the path without hard coding each new path.

import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
mxd.findAndReplaceWorkspacePaths(r"C:\features\points", r"N:\features\points")
mxd.saveACopy(r"C:\Project\Project2.mxd")
del mxd


texts:
Can someone please explain why these two shapefiles are different:

Neighborhoods in Cambridge, MA ; and
Water bodies in Cambridge, MA.

In particular, I am having trouble working with the water bodies shapefile. The program I am using (Stata) gives the following error message when I try to work with the water shapefile: "point, polyine, or polygon shapefile required." However, the neighborhood shapefile works just fine.


texts: QGIS - Change project variable using a dropdown menu

texts:
This is my first time in trying to develop any automation within the QGIS environment.
I am trying to change a user defined project variable – DMA select – programmatically.

The changed project variable is then used to change the parameter in rule based symbologies for 2 layers using the single variable.

I have written a script that can change the project variable on the Python console when I change the variable manually in the script.
project = QgsProject.instance()
QgsExpressionContextUtils.setProjectVariable(project,'DMA_Select','NORTHMEAD')
iface.mapCanvas().refreshAllLayers()

I have also created a form in QT Designer with a dropdown of the possible values for the project variable.

What do I do next to combine this together so that the selected vale from the combo box can change the project variable?
I've searched around the internet and guides/books for this particular solution and have not came up with anything. I can see that we can bind the form/UI to layers but cannot find an example where it is used to change a project or global variable.

I have inserted in the file change_variable.py - between def initGui(self): and  def unload(self):
    def VariableValue(self):
        self.setVariableValue(value)):
        project = QgsProject.instance()
        QgsExpressionContextUtils.setProjectVariable(project,'DMA_Select', value)

        #iface is accessed by self.iface inside the plugin
        self.iface.mapCanvas().refreshAllLayers()

and then in the def run(self): section after
#comboBox is the UI objectName
self.dlg.comboBox.currentTextChanged.connect(lambda currentText: setVariableValue(currentText))

When I open QGIS i get the error message

on the plugin load

change_variable.py changed

The plugin loads okay but when run and dropdown is selected I get this error


texts: Leaflet - select markers within the radius given with details provided

texts:
I know the tool in Leaflet, provided by this link:

http://www.gistechsolutions.com/leaflet/DEMO/Select/SelectPoints3.html

which enables me to select a markers within 150mi distance. This is fine, although there is an utter lack of the marker details when clicking on the map. Highlighted markers are seen in different colour within the radius, unfortunately I cannot populate their details in the i.e list on the side panel.

Is it possible at all?


texts: Define polygon with even number of points?

texts:
I have the following problem.....  I have a client that needs an equal number of schools divided up between 8 different zones.

The state I am looking at is the state of Maryland.  They want to use the zip code that each school is in instead of the actual location of the school.

So, for example, ZIP 21050 might have 13 schools, 20601 has 5, 20618 has 15, 20623 has 9, etc etc etc....

How can I break up the state into 8 overall zones, and with each zone having an equal (or close to equal) number of schools?  The zones will be bound by zip code boundaries.

The purpose is for some kind of inspections I believe and they want each of the 8 inspection teams to have roughly the same number of schools to cover....

Any advice?


texts: Arcgis Runtime .NET for WPF scene with elevation source shows flat instead

texts:
I tried the Arcgis tutorial from here. It shows how to add basemap and elevation so that the scene would show a 3D surrounding, but it doesn't. Can someone help me?

This is my .cs file

    private void Initialize()
    {
        // Create a new scene
        var myScene = new Scene(Basemap.CreateTopographic());
        Map3D.Scene = myScene;

        // create an elevation source
        var elevationSource = new ArcGISTiledElevationSource(new System.Uri("http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"));
        // create a surface and add the elevation surface
        var sceneSurface = new Surface();
        sceneSurface.ElevationSources.Add(elevationSource);

        // apply the surface to the scene
        Map3D.Scene.BaseSurface = sceneSurface;

        // Create camera with an initial camera position (Mount Everest in the Alps mountains)
        var snowdonCamera = new Camera(53.06, -4.04, 1289, 295, 71, 0);

        // Set the scene view's camera position
        Map3D.SetViewpointCameraAsync(snowdonCamera);
    }

And this is my xaml file

<Grid>
    <esri:SceneView x:Name="Map3D"/>
</Grid>


texts: Geometric Network for Electric Utilities?

texts:
I'm not expert in the use of geometric networks nor in Python scripting and I need help with the following problem. I'm using ArcGIS 10.0.

I have defined a geometric network for an electric distribution network in medium and low voltage, with an own (basic) data model. The main feature classes included in the geometric network are Distribution Centers (points), Medium Voltage Feeders (lines), Substations (points), Low Voltage Cables (lines), Meters (points).

Each distribution center have several outputs with medium voltage feeders. Each substation has multiple outputs with low voltage cables, each with its own identifier.

I have to simulate outages in any parts of the network, identifying all affected users (meters). This part is pretty simple with "Utility Network Analyst" tools, with which I can select affected items in each feature class.

I have to pull attributes from multiple feature classes and combine them into a single table.The goal is to generate a table with the “connection diagram” of each meter, i.e. one record per meter affected by the outage with the following attributes: ID meter, ID low voltage cable, ID substation , medium voltage feeder ID, ID distribution center. Each attribute comes from a different feature class and I must build a table with corresponding values that indicate how each meter connects trough the network to each distribution center.

I think there is no way to accomplish this with the 'Utility Network Analyst' but perhaps there is a tool or some python script that can help me to solve the problem.

Either way I think that the solution is to create an own script. In an ESRI forum, very kind people recommended developing a bidirectional script (trace down and then up) using the CreateRow, Set_Value to generate the new row to insert into the connection diagram table and perform the required task.

Does anyone have examples on how to do this or starting point scripts?


texts:
I develop an Android app that uses Mapsforge to display OSM maps. I could use a pre-built map in the MapsForge file format but that makes my APK file to big and I only need a small part of my country anyway.

How can I only get a small rectangle part of the world of OSM and put it in a map file?


texts: QGIS / Python: Fill new field with values based on other fields and lookup table

texts:
I am trying to use Python for QGIS to add values to new fields in an attribute table based on existing fields and values in a lookup table.

Attribute table I wish to modify (with example rows):

farm      | ref_1 | ref_2 | newField_1 | newField_2
Macdonald | seeds | veg   | <Null>     | <Null>
Fred      | seeds | fruit | <Null>     | <Null>
Bob       | seeds | fruit | <Null>     | <Null>

Lookup table:

ref_1, ref_2, lookup_1, lookup_2
seeds, fruit, 13, 4
seeds, veg, 10, 3

Assuming newFields 1 & 2 have been added to the attribute table, my code is as follows:

aLayer =  qgis.utils.iface.activeLayer()
provider = aLayer.dataProvider()

lookup_table = np.loadtxt(r'filepath\myfile.csv',dtype=str,delimiter=',',skiprows=1)
aLayer.startEditing

for feature in aLayer.getFeatures():
    for i in lookup_table:
        if i[0] == feature['ref_1'] and i[1] == feature['ref_2']:
            provider.changeAttributeValues({feature.id() : {provider.fieldNameMap()['newField_1'] : i[2]}})
            provider.changeAttributeValues({feature.id() : {provider.fieldNameMap()['newField_2'] : i[3]}})
            aLayer.updateFeature(feature)
aLayer.commitChanges()

After running the code, the newFields 1 & 2 remain null.

Referring to Setting feature attribute by name via QGIS python api? I can get provider.changeAttributeValues() to work based off of fields within the same table (e.g., changing newField_1's value to that of farm); however, if I reference a lookup table, newFields 1 & 2 remain null.


texts: Building WKB from geometry using ArcObjects?

texts:
I have some points in an array,stored by user click on the map in ArcMap,and I want to build a polyline and create a Well Known Binary sequence.

I use IPointCollection interface to add this points to Polyline object,and when I draw this polyline,it shows line successfully but the function
"CreateWkbVariantFromGeometry" returns E_OUTOFMEMORY error when I pass this geometry into it.What's wrong with this method for creating a plolyline?

IPolylinePtr ipPL(CLSID_Polyline);

IPointCollectionPtr ipPC;

if(ipPL->QueryInterface(IID_IPointCollection,(void**)&ipPC)!=S_OK)
        return E_FAIL;
for(int i=0;i<myPointCount;i++)
{
    IPointPtr ipP=this->GetPoint(i);
    if(this->m_ipDispTrn->ToMapPoint(this->m_Points[i].x,this->m_Points[i].y,&ipP)!=S_OK)
        return E_FAIL;
    if(ipPC->AddPoint(ipP)!=S_OK)
        return E_FAIL;
}
IGeometryPtr ipG;
if(ipPL->QueryInterface(IID_IGeometry,(void**)&ipG)!=S_OK)
    return E_FAIL;

//.Drawing line on the screen catch . ipS is a SimpleLineSymbol object
//....................................................StartDrawing here
this->m_ipSDisplay->SetSymbol(ipS);
if(this->m_ipSDisplay->DrawPolyline(ipG)=S_OK)//This line works successfully
    return E_FAIL;
//....................................................FinishDrawing here

//.Building WKB from geometry
IGeometryFactory2Ptr ipGF;
IGeometryEnvironmentPtr ipGE(CLSID_GeometryEnvironment);
if(ipGE->QueryInterface(IID_IGeometryFactory2,(void**)&ipGF)!=S_OK)
    return E_FAIL;
VARIANT var;
HRESULT hr=ipGF->CreateWkbVariantFromGeometry(ipG,&var);//hr=E_OUTOFMEMORY
if(hr!=S_OK)
    return E_FAIL;


texts: Wrong position when reprojecting layers from EPSG:32651 into EPSG:4326

texts:
I have a vector layer on my project that I digitized from a geologic map. I originally projected it on WGS 84 UTM Zone 51 North (EPSG:32651) when I was digitizing. I tried reprojecting it to WGS 84 (EPSG:4326) since I was trying to make a susceptibility map with my other layers (which was on WGS 84.
Even though I reprojected it, the layer is still on the same position. I want it to align with my WGS 84 layers since I'm going to process it. I have this problem also on my raster file which is on WGS 84 UTM zone 51 North that I'm  trying to reproject to WGS 84 and still, it's on the same position. I also tried reprojecting other data layers and it seems to run correctly so I don't think my GIS software is the problem here. Here is a screenshot of my project together with the layer properties. As you can see the layer is on WGS 84 already but its still on the UTM position, as you can see the decimal degrees below the status bar.

I checked a layer that has the same projection I want to reproject. They are on the same projection but different extent. I tried to change the extent manually on ArcGIS but still to no avail.


texts: Read a CSV with two Polygons(WKT) with GDAL

texts:
I am trying to read a CSV file where the geometries of neighbouring polygons are stored in couples. The file looks like this.

I usually read  shapefiles in GDAL using the following syntax

GDALAllRegister();

GDALDataset       *poDS;
poDS = (GDALDataset*) GDALOpenEx("shape.shp", GDAL_OF_VECTOR, NULL, NULL, NULL );
if( poDS == NULL )
{
    printf( "Open failed.\n" );
    exit( 1 );
}

OGRLayer  *poLayer;
poLayer = poDS->GetLayerByName("shape" ); // returns the layer that refers to the name (name.shp)
cout <<"There are " <<  poLayer -> GetFeatureCount() << "features"<<endl ;
OGRFeature *poFeature;

But this of course doesn't work. The documentation found here (http://gdal.org/1.11/ogr/drv_csv.html) did not help me at all unfortunately.

I would like to know if there is a way to read this file in GDAL. I am coding in C++, but an answer in Python would be informative as well.


texts: Buffer and Dissolve/Union 2 million points

texts:
I'm looking for a solution that will let me add a 100m buffer around 2 million points and then dissolve/union that output into a single multipart polygon.

On a much smaller scale (100 points) using R I can do this:

library(sf)
bbox <- st_sfc(st_polygon(list(rbind(c(0,0),c(90,0),c(90,90),c(0,90),c(0,0)))), crs = st_crs(27700))
points <- st_sample(bbox,100)
buffer <- st_buffer(points,5)
union <- st_union(buffer)

However, I know this will not scale well.

Are there any solutions using any tool (preferably something that is free) that could run this type of operation on a laptop with 20GB RAM without crashing or taking days to complete?


texts: How to skip over errors created by cursors running through empty tables?

texts:
I am trying to automate the creation of many different feature layers were their content is created by a cursor. Sometimes during the automation, a feature layer may be empty, this is okay, but as the cursor runs through the layer adding in the data, the del row line returns the error:

"NameError: name 'row' is not defined" and stops the script.

Question:
If a layer I am creating happens to be empty, how can I skip over any errors that might pop up due to the cursor not being able to define itself in an empty table?

Already Tried:
I tried setting a 'count' variable to how many rows are in each table, and telling python to skip over the table if it has less than 1 row, but the "del row" line still caused a fuss, and I had trouble setting up the try statement.

The code below is still returning the error. It is not printing empty cursor yet the ACount is indeed 0.

cursor = arcpy.da.UpdateCursor("A_Squares", ["LEGEND"])
ACount = arcpy.GetCount_management("A_Squares")
print ACount
if ACount == 0:
    print "empty cursor"
else:
    for row in cursor:
        row[0] = TableA
        cursor.updateRow(row)
    del row
    del cursor

Any ideas?


texts: Getting the right attribute values using Dissolve in QGIS

texts:
I have a layer with polygon features with attribute ZIPcode and attribute A. The attribute A can has the value X or NULL. So there is only one distinct value in the dissolved polygons.

How can I Dissolve the polygon layer with Zipcode as Dissolve field so that the value of attribute A is taken (survives) to the Dissolved layer?


texts: Using lookup from CSV in Field Calculator?

texts:
Is it possible to access a CSV in order to feed a certain value from the CSV into an attribute's field calculator expression? Ex.:

CSV will be as such:

ITEM    COST
FOOT    100
THING   200

My polyline layer will have a length measurement in FT and an arbitrary number of THINGs for each feature.

I need to multiply the $/FT value from the CSV by the length measurement for each feature.

I need to multiply the $/THING value from the CSV by the number of THINGs per feature.

How can I get the $/FT and $/THING data from the CSV into the polyline layer in order to add a new field with $/length measurement and a $/total # of THINGs for each feature?

The aim is to easily change the CSV values instead of hard-coding them in the  Field Calculator.


texts:
I am having trouble illustrating multiple properties on QGIS.

Basically I want to illustrate multiple properties/polygons based on their identifying fields - lot and plan.

Can anyone give me an expression string to use that will allow us to show multiple lots and filter out the lots we don't want to show?


texts:
I am trying to visualize specific GeoJSON data.

I am successfully loading the full GeoJSON file (Multipolygon) using Leaflet JS. Is there any query to find specific polygon from that GeoJSON file?

For an example I am using USA state GeoJSON data. I am using a dropdown list to call specific states such as California - CA. How can I call that specific GeoJSON data of where state = California?


texts: Getting shapefile of habitat data to split itself into each separate buffered area using ArcGIS Desktop?

texts:
I'll explain what I'm working with from the beginning so that hopefully I'll be coherent. I am using ArcMap 10.4.1. I have a set of 1037 points in a 500m grid in my study area and am interested in an area around each point with a 1250m radius. So, I created a 1250m buffer around each point. I also have a shapefile with habitat data for the entire study area and I am interested in knowing the habitat composition of EACH buffer zone.

With another dataset where my buffers were only 115m and so did not overlap, I managed this by using a spatial join with intersect of the buffer shapefile and the habitat shapefile, using Multipart to Singlepart to split the habitat polygons, and then Recalculate Geometry to get the new area values within each buffer zone.

However, when I do this same series of steps with my 1250m overlapping buffer zones, the spatial join works well and it tells me which buffer zone each habitat polygon is within, but it will not split the area of the habitat polygon. For example in the screenshot: the small habitat polygon at the bottom that I have selected lies entirely within the buffer zone of point 1037 but only around 60% of it is within the buffer zone of point 1036. In the attribute table the SHAPE_Area is assigned the same value for both (top is 1036 and second is 1037) but I would like it to calculate the area that lies only within each buffer zone separately.

The only other thing I can think of is to manually select each buffer zone and do a spatial join on each one, but I'm hoping someone knows a better way, since I don't particularly want to do that 1037 times. Any ideas?


texts: Converting GeoJSON pixel coordinates to lat long coordinates for use with Google Maps API?

texts:
The entire process is quite a bit more complex than the question, so let me briefly describe it:

An SVG overlay of map features is parsed.

Each path is converted to WKT using SVG-to-WKT and then parsed into a GeoJSON Polygon by Terraformer.

The coordinates of that Polygon are each converted from pixel values to latitude and longitude using the below function pixelToLatLng (I forgot which article I derived that from). The pixel size was completely arbitrary and I don't particularly like that solution, especially as I haven't tested with other SVGs.

function pixelToLatLng(coords) {
    var pixelSize = 0.00002;
    var upperLeftCoord = [151.3358, -32.6615]; // Reference point for SVG viewbox
    var x = upperLeftCoord[0] + (parseFloat(coords[0]) * pixelSize);
    var y = upperLeftCoord[1] + (parseFloat(coords[1]) * pixelSize);
    return [x, y];
}

These values are used to create a Feature and in turn a FeatureCollection which is then added to a Google Maps data layer.

The issue is that the drawn data layers are slightly stretched vertically. I realise this is due to the mercator projection, but I'm having trouble determining what I need to convert and at what point I should do it.


texts:
For a merge operation I need a list of all my layers in the TOC with path and filename. How can I achieve that?

layers = QgsProject.instance().mapLayers() # dictionary
myLyrList[]
for layer in layers.values():
   print(layer.name())
#Here I need a List of the my layers in the toc with the path and the filename
processing.run("native:mergevectorlayers", {'LAYERS':['/home/lissiklaus/Downloads/2.shp|layername=2','/home/lissiklaus/Downloads/3.shp'],'CRS':QgsCoordinateReferenceSystem('EPSG:31468'),'OUTPUT':'TEMPORARY_OUTPUT'})


texts: Moisture Interpretation from Landsat Images

texts:
I am working on a "land suitability for crop" project. Can anyone let me know how to get any type of information which can be related to moisture index of soil?

I have Landsat 5 data with band 3 and band 5 and working on ArcGIS 9.3.  Any type of suggestion is most welcomed.


texts: How to get the long/lat information from a NodeID and vice versa

texts:
In the SpatiaLite website they explain how to use .osm data to create a SpatiaLite database, that contains a single table, where each row is an arc of the road graph. Then, they explain the procedure of calculating the shortest path from A to B in their website:

Create the VirtualNetwork from a .osm file using a tool they provide
Execute the following query: select * from VirtualNetwork where NodeFrom=267209305 and NoteTo=267209702 to get the shortest path
Below the result you are supposed to get from the query above. It represents every arc on the shortest path.

Questions:

How to get the Latitude/Longitude from every NodeID that is on the shortest path. Otherwise, I will not be able to interpret what those NodeIDs mean.
How to get the NodeIDs from the Latitude/Longitude of NodeFrom and NodeTo. Otherwise, I will not be able to execute the shortest path query in the first place.


texts: Using ArcPy to batch merge based on shapefile name?

texts:
ArcGIS 10 SP4
Python 2.6.5

I have quite a few shapefiles that are in many different directories. I'd like to pull out groups of like shapefiles, merge them, and move the results into a FGDB. I've read the posts about making a GIS inventory, using a .csv as an input list, as well as few others. Those seem to point me in the right direction, but I'm still having a hard time wrapping my head around it. Obviously I'm new to Python, but believe automating this process is within my abilities.

It seems easy conceptually, but I don't have enough experience to generate the code.

Make multiple lists based on the shapefile name (startswith?)
Use those lists as inputs for a batch merge.
Convert merged files to GDB


texts: On my one laptop, I have 3.12.2 installed, on the other 3.14.15. In 3.12.2, I can see ESRI FileGDB as a type in the directory, in 3.14.15, this option is not there. Panicking a bit, as relying on being able to open ESRI GDB's for teaching purposes next week, but with 3.14.15 installed, students will not be open the data supplied!


texts: Geoprocessing LineIntersections QGIS Python

texts:
I am trying to make a QGIS plugin, and one of my goals is to use the geoprocessing tool "intersection" of QGIS into my Python code for the plugin.
When I run it directly into QGIS, it works perfectly (especially transferring all attributes of both layers intersected).

When I run it in Python code, the result is the same but the attribute table does not contain all attributes (only one attribute...).

Here is an extract of my code for this purpose:

processing.runandload("qgis:lineintersections", final_layer1, final_layer2, "", "", output_intersect_path)

I also tested:

processing.runalg("qgis:lineintersections", final_layer1, final_layer2, "", "", output_intersect_path)
intersect_temp = QgsVectorLayer(output_intersect_path, output_intersect, "ogr")
QgsMapLayerRegistry.instance().addMapLayer(intersect_temp)

The problem lies in the parameters: final_layer1 and final_layer2 or the layers intersected. Then, the source help says "Field A" and "Field B", but I do not know what to put for those parameters in order to get all attributes transfered...

Does someone know how to do that ?

Here is my code:

    layer1_field = "last_fieldName"
    layer2_field = "last_fieldName"

    ouput_0 = processing.runalg("qgis:lineintersections", final_layer1, final_layer2, None, None, None)
    output_1 = processing.runalg("qgis:joinattributestable", ouput_0['OUTPUT'], final_layer1, layer1_field, layer1_field, None)
    result = processing.runandload("qgis:joinattributestable", output_1['OUTPUT_LAYER'], final_layer2, layer2_field, layer2_field, None)

Don`t know why it is not good at all....

Here are the source shapefiles to test.


texts: In Tilemill, is there a way to prevent overlapping labels or "hide" labels very near eachother aside from "text-allow-overlap:false"?

texts:
I want to style in Tilemill some labels. In the original shapefill there are some points which are near to eachother, which causes in Tilemill to make labels also very near eachother. I was wondering if aside from "text-allow-overlap:false;" there is another way to prevent overlapping labels?
is there maybe a way to hide one of the labels or both of them with a specific styling?
perhaps create a "perimeter" around the labels, so eg so whatever label is in  perimeter would not appear.
In gerneral is there any way to hide labels that are very near eachother?
Many thanks in advance.


texts: Zoom to the extent of the WMS layer in GeoServer by OpenLayers 3?

texts:
I would like to use OpenLayers 3 (I saw similar question for OpenLayers 2) to display a GeoServer layer using WMS, and zoom to the extent of the layer automatically by getting the extent information from this layer. Just like when preview the layer on GeoServer, it displays the layer within the layer's extent and no matter what the CRS of the layer is.

I have installed Opengeo suite 4.5 and created a viewer with the suite-sdk viewer template. I debug with suite-sdk debug -g http/to/geoserver  path/to/app

The viewer uses OpenLayers 3 library. I have added OSM layer and my GeoServer layer with ol.source.TileWMS source and display them successfully.

I get the capabilities of my local GeoServer WMS service (ol3 example). With the results, by checking the name of each layer, I would like to zoom to my target layer.

//
// the codes add layers to ol.map and intial the ol.view
//

// TODO: zoom to layer
var featurePrefix = '***';
var featureType = '***';
var url = 'http://localhost:port/geoserver/wms?request=GetCapabilities&service=WMS&version=1.1.1';
var parser = new ol.format.WMSCapabilities();
$.ajax(url).then(function(response) {
   var result = parser.read(response);
   var Layers = result.Capability.Layer.Layer;
   var extent;
   for (var i=0, len = Layers.length; i<len; i++) {
     var layerobj = Layers[i];
     if (layerobj.Name == featurePrefix + ':' + featureType) {
         extent = layerobj.BoundingBox[0].extent;
         break;
     }
     console.log(layerobj.Name);
   }

   // THIS DOES NOT WORK
   map.getView().fitExtent(extent, map.getSize());
});

With the code above, I can get the BBOX of the layer in its own coordinate system other than ESPG::3857. But the map did not zoom to that layer. I think it is a coordination system problem.

How can I solve it, or another approach to get the extent?

(I found the current code is not nice)


texts: Drawing polygons from legal descriptions using bearing directions in ArcMap?

texts:
I have many property descriptions I need to add into my GIS that are described using bearings (such as South 01 degrees 41'46" West for 25 feet, then continuing in a different bearing to create a closed area of land). I understand that there may be errors due to projecting these since they are based on a ground-based local plane, but I am simply trying to get the drawing aspect down right now. Unfortunately, the majority of these descriptions are not in a spreadsheet or any type of digital format (such as the guy here was using COGOing Legal Descriptions), they are either on paper or old scanned documents dating as far back as the 1980s.

I tried using the Traverse tool in the COGO toolbar, but when I enter Direction and Distance (using the example above, typing in the format S 01-41-46 W, 25 ft) the "Add" button is greyed out and I am not able to add the line. I am using an empty line feature class and a starting point from a corner of a section/township/range. The ESRI help section on creating traverses seems quite straightforward, I feel like I'm missing something.

Is the traverse tool the right one to be using?


texts: How to filter style to display only where data in one column in the attribute table is not the same as the data in another column

texts:
I have a .shp with attribute data containing current zone, current code, proposed zone, proposed code, final zone, final code etc.

I want to duplicate this layer and style it to display a black outline style only where there is a mismatch between data in columns, this in effect creates a map that identifies where there is a change proposed to draw attention to these areas.


texts: Is it possible to publish the raster contents of a directory as an ESRI 10.3 Image service?

texts:
I am currently experimenting for the first time with ArcGIS Server 10.3.1 and have been told that I can publish contents of a directory (TIF Aerial Images)as an Image Service. In the ESRI Help I can not however see this option.

Can anyone confirm that this can or cannot be done?


texts: How precise are overpass times of sun-synchronous satellites?

texts:
sun-synchronous satellites, as their name say, acquire scenes at the same solar time of the day when they pass over the same location. According to this site, sun-synchronicity is achieved by taking advantage of nodal regression and launching a satellite into an orbit where the nodal regression nearly exactly cancels out the daily change in the position of the sun over any point on earth, caused by the earth's orbit around the sun. This turns out to be, depending on the altitude of the satellite, about 95 to 100 degrees inclination.

The local time of descending node (or overpass time) is usually mentioned on the satellite descriptive documents. I would like to know how precise the solar time provided in those descriptive documents actually is and how to improve this precision based on potentially effecting parameters (altitude, latitude, longitude, day of year, age of the satellite). My understanding is that the main difference comes from local solar time vs mean solar time (see equation of time, up to 18 minutes), but I am seeking an order of magnitude of the other possible sources of dicrepancies between the announced overpass time and the actual local solar anywhere in the world.

I have several satellites in mind (the Sentinel's, MODIS, Landsat...), but I am particularly interested in PROBA-V. PROBA-V flies at an altitude of 820 km in a sun-synchronous orbit with a local overpass time at launch of 10:45 h. Because the satellite has no onboard propellant, the overpass times are expected to gradually differ from the at launch value. Examples of drift correction for satellites like Sentinel-2 are also welcome.


texts: How to create button that calculates acres on selected polygon features?

texts:
I'm looking to create a simple button that calculates acres on selected polygons and can't quite find what I'm looking for. I read through this thread: automating a python script..., but found it wasn't quite what I am looking for. My Python skills are very near nil, I'm using ArcGIS 10.1 SP1 for Desktop (Build (3143).

I'm aware of !SHAPE.area@ACRES!, but need help getting into button form that resides on my toolbar.

EDIT:
I've pieced some code together from several examples here & around the net. When I add the button to ArcGIS, highlight a polygon and click, nothing happens. Nothing. I'm obviously something and hope it's just one big hump to get me there. Below is the code thus far.

import arcpy
import pythonaddins

class CalculateSelectedAcreage(object):
    """Implementation for AcreageAddInTest_addin.CalcAcresSelected (Button)"""
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
        # Implementation of OnClick method of Button's class
        # Get the current map document and the first data frame.
        mxd = arcpy.mapping.MapDocument('current')
        df = arcpy.mapping.ListDataFrames(mxd)[0]

        # Get the feature name to work with
        in_featureclass = arcpy.GetParameterAsText(0)

        # Set local variables
        field_Name = "Area"
        field_Type = "DOUBLE"
        field_Precision = 18 # total number of digits stored
        field_Scale = 8 # number of decimal places

        fieldList = arcpy.ListFields(in_featureclass, field_Name)
        fieldCount = len(fieldList)
        if fieldCount == 1:
            # field already exists, as it does in DI Landtracs
            arcpy.calculateField_management(in_featureclass, field_Name, 'float(!SHAPE.area@ACRES!)', "PYTHON_9.3")


texts: Using spei() function on time series from rasterstack in R?

texts:
I want to use the spei() function in the SPEI package on a raster stack of monthly time series of water balance data. The stack has 30 years of monthly data, so 360 layers. The documentation for spei() https://cran.r-project.org/web/packages/SPEI/SPEI.pdf states the input should be "a vector, matrix or data frame with time ordered values", along with a lag (number of months). Can I run spei() without converting each pixel in the stack to a time series vector? I have explored this thread -> Apply SPEI::hargreaves function to time series from each pixel rasterbrick R which got me started setting dates as the Z dimension in the stack.

library(raster)
library(SPEI)
library(zoo)

wb.files <- list.files(path = <pathway to files>, full.names = TRUE)
wb.stack <- stack(wb.files)
dates <- seq(as.Date("1971-01-01"), as.Date("2000-12-31"), by="month")
wb.stack <- setZ(wb.stack, dates)
names(wb.stack) <- as.yearmon(getZ(wb.stack))

Then when I try to run the function, I get an error.

system.time(spei.r <- spei(wb.stack, 2))

The error I get is:

#Error in sum(is.na(data)) > 0 & na.rm == FALSE :
#  operations are possible only for numeric, logical or complex types

In the thread above, the raster::overlay() function is used, and the equivalent for a single raster stack is calc() so I tried using that too.

speicalc <- function(dat, sc) {
  SPEI::spei(dat, sc)
}

system.time(spei.r <- raster::calc(wb.stack, 2, fun = speicalc))

The error I get in that case is:

#Error in .calcTest(x[1:5], fun, na.rm, forcefun, forceapply) : cannot use this function

I would like to avoid collapsing every pixel to a vector or data frame, which seems like it would be very inefficient.


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

texts:
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?

I can't view the help because my OS cannot read .hlp files (yet).


texts: Speeding up workflow of generalizing OpenStreetMap road data?

texts:
Whenever I want to use OSM data for medium scale maps (e.g. 1:200.000) I run into problems.

On the screenshot below one can see the orange street that goes from north to south. It has the attribut highway=primary. I created the "orange road category" by merging these highway-attributes: primary, primary_link, secondary, secondary_link, trunk, trunk_link. This will be the main road" category in my final map.

In contrast to that, the red roads belong to categories I don't want to show on the map (residential, service, path, steps, footway, etc.). I want to exclude them.

The problem is that the orange road is interrupted in the middle of the map by a red road, that belongs to highway=residential.

Now I can choose between three bad options:

Include all "residential" roads, which solves this one problem, but creates many other problems and makes the map messy.
Exclude the "residential" road and I have an interrupted street.
Edit manually.

I run into this problem many times. It occurs on several other instances in this specific map but also in many other of my map-making processes.

Can you recommend a better workflow for handling OSM road data for medium scale maps?


texts: Creating arc segment between two points with common field using Python?

texts:
I need to create Arc Segments between multiple points with like data using half the distance between the two like points as the radius of the arc segment.

I would prefer to use python to accomplish this.


texts: Python: Convert DEM to 3D array organized as [lat, long, elevation]

texts:
I'm trying to convert a .tiff DEM to a numpy array using python. Ideally the array will store latitude, longitude (or some coordinate alternative), elevation).

I'm using Gdal but currently it only saves elevation values and the positional data is lost.

Current code:

import os, sys
import numpy as np
from osgeo import gdal, osr

gdal.AllRegister()
gdal.UseExceptions()

# Open Image
fpath = ('*location*\\DEM.tif')
inRas = gdal.Open(fpath)
if inRas is None:
  print ('Could not open image file')
  sys.exit(1)

# read in the crop data and get info about it
band1 = inRas.GetRasterBand(1)
rows = inRas.RasterYSize
cols = inRas.RasterXSize

cropData = band1.ReadAsArray(0,0,cols,rows)

Sample output from:

print(cropData.shape)
print(cropData.size)
numrows = len(cropData)
numcols = len(cropData[0])
for i in range(numrows):
  for j in range(numcols):
    print(cropData[i,j])


texts: Replacing '+' with ', ' for labels in QGIS?

texts:
I want to replace a '+' with ', ' to label an attribute looking like "ZT10+ZT20+ZT30" to get "ZT10, ZT20, ZT30" using

regexp_replace("zone_nr", '+', ', ')

but I get an Eval Error: Invalid regular expression '+': quantifier does not follow a repeatable item.


texts:
I used IFeatureLayerDefinition.CreateSelectionLayer() to create a new IFeatureLayer then i cast this one to ILayer and set it to the Map, my problem is that i can't zoom programmatically to this ILayer, i tried to call ICommand.ControlsMapFullExtentCommandClass but it didn't work.

This is my code :

public static void myFunction(ITable table_commune, string code_commune)
{

        if(table_commune == null || code_commune == null) return;

        ILayer layer = (ILayer)table_commune;
        IFeatureLayer featureLayer = (IFeatureLayer)layer;

        IFeatureLayerDefinition featureLayerDef = (IFeatureLayerDefinition)featureLayer;

        IFeatureLayer new_featureLayer = featureLayerDef.CreateSelectionLayer("Commune", false, null, "NUM_COMMUNE = " + (code_commune));
        ILayer new_layer = (ILayer)new_featureLayer;

        Map.AddLayer(new_layer);
        Map.ActiveView.Refresh();

        ICommand command = new ControlsMapFullExtentCommandClass();
        command.OnCreate(Map.Object);
        if(command.Enabled) command.OnClick();
}


texts:
I am trying to calculate the temperature per district in Afghanistan with the following code. However, I receive the following error when trying to calculate the mean per district:

  Unrecognized arguments (collection) to function:
  Image.reduceRegion(image, reducer, geometry, scale, crs, crsTransform,
  bestEffort, maxPixels, tileScale)

///Code

var region = ee.FeatureCollection('users/mm/countries')
.filterMetadata('COUNTRY', 'equals', 'Afghanistan');

var districts = ee.FeatureCollection('users/mm/AFG_districts')

var modisLSTday = ee.ImageCollection('MODIS/MOD11A2')
.select('LST_Day_1km');

var modLSTday = modisLSTday.map(function(img) {return img.multiply(0.02)
.subtract(273.15)
.copyProperties(img,['system:time_start','system:time_end']);});

var collectionday = ee.ImageCollection(modLSTday).filterDate('2014-01-01', '2015-01-01');

var clippedday = collectionday.mean().clip(region);

var clippedday_district =  clippedday.reduceRegion({
  collection: districts,
  reducer: ee.Reducer.mean(),
  scale: 400,
})

;


texts: Using QGIS to create road map layered on top of a topography map

texts:
Forgive me for my lack of knowledge on GIS. I have only very recently come across this subject, and I believe that I can arrive at what I'm looking for using QGIS and OSM data. I'm a bit lost with all the available information.

I want to create an map where I can layer different levels of road infrastructures (motorways, primary, secondary) on top of a topography map. I'm doing this because I enjoy motorcycle touring and am trying to plan trips through twisty mountain roads. If at all possible, I'd also like to be able to overlay this information on Google Earth Pro, so that I get the street-view option. I'm looking for European roads, particularly for Portugal and Spain.

Am I asking for too much? And if not, could you give me some pointers as to what I should do?


texts:
I tried to make an hillshade and a slope map from a DTM using QGIS but the result shows some artifacts.

As you can see in the picture there is a grid texture in the hillshade and the slope map.

I downloaded the DTM files from:

http://opendata.regione.abruzzo.it/content/modello-digitale-del-terreno-risoluzione-10x10-metri.

The DTMs have the UTM-WGS84 coordinate system and a resolution of 10m. Every DTM is a GeoTIFF floating point 32 bits with a TFW associated.

I used the VRT builder to generate e virtual raster from the DTMs, then I used Warp to reproject the VRT into the same coordinate system of the original DTMs but using bilinear interpolation as "resampling method". I used the reprojected raster to make the hillshade but the grid texture was still there. Then I changed the "output raster type" to Int32 in the Warp tool, and I used the output to generate another hillshade but the texture was still clearly visible.

Do you have any idea why this is happening?


texts: Using Google Earth Engine to clip images according to region polygon shape when exporting to Drive?

texts:
Normally, I do export images which are rectangles whatever the shape of the region is, then I clip them on a GIS software.

Is there a way to do it directly in GEE?

This is the code I use for exporting

Export.image.toDrive({
  image: mejorImagen,
  description: 'Landsat8_Ab_2013',
  scale: 30,
  region: Abast
  });


texts: OpenLayers 3 (3.8.2) How to set a blank Basemap?

texts:
I want to add a blank (empty) base map option to the set of radio button .

Here is how a part of my code looks:

// MapQuest streets
new ol.layer.Tile({
  title: 'Street Map',
  group: "background",
  source: new ol.source.MapQuest({layer: 'osm'})
}),
// MapQuest imagery
new ol.layer.Tile({
  title: 'Aerial Imagery',
  group: "background",
  visible: false,
  source: new ol.source.MapQuest({layer: 'sat'})
}),
// MapQuest hybrid (uses a layer group)
new ol.layer.Group({
  title: 'Imagery with Streets',
  group: "background",
  visible: false,
  layers: [
    new ol.layer.Tile({
      source: new ol.source.MapQuest({layer: 'sat'})
    }),
    new ol.layer.Tile({
      source: new ol.source.MapQuest({layer: 'hyb'})
    })
  ]
}),


texts: way/tool to automatically generate polygons on map knowing polygon width and height and spacing

texts:
I need to create a large number of polygons (say 1000) on a georeferenced mosaic (from aerial photographies). I know polygons' height and width, and I know the spacing between them. I can also provide the edges of the containing polygon.

Let's say,I want to create 1mts x 3mts polygons with a 0.5 mts (both vertical and horizontal spacing) in the area delimited by the rectangle defined by points (p1, p2, p3, p4).

Does anyone know about a tool to do this automatically? Or any recommendation on its implementation?


texts: Lambert-Conic projection - GPS of corners

texts:
I have an 2D image in Lambert-Conic projection. I know the bounding box of coordinates, but I want to calculate the coordinates of image corners. They don't have to be the same as bounding box. How can I achieve this?

On the picture, the black dots are corners of 2D image in Lambert-Conic projection. The entire image below represents the bounding box as in "no projection". It can be seen that the max latitude does not correspond to any point directly.

The effect can be seen in the below pictures. Left (red) is image in Lambert projection - it is square but corners are not of the same latitude / longitude. On the right (blue) the image is reprojected to the "no-projection" and I am looking for coordinated of the blue corners - that are same as black dots in above image.


texts: Raster to vector (polygons) with generalisation

texts:
I have created rasters showing different types of vegetation (bushes, trees, open land) with help from lidar data. Now I'm looking for a method to turn these images into polygons.

I'm using a Mac and preferably QGIS, GDAL, GRASS etc. I do have the possibility to use Windows but I'd prefer staying in Mac OS X.

Here is the source image:

Blue (with some red) means trees and red is bushes. White is open land.

And this image (drawn by hand) is kind of what I'd like to achieve:

Any ideas?

I've tried r.neighbors some but I'm not satisfied.

Update: I have now tried Majority and it looks better. But the narrow part in the south east part is not being included. I guess those dots are not in "majority". How could I make them being included? It's like if I need minority but not extreme minority...

See image below (note that I have only included bushes, the red color from the original image):


texts:
I work for an aerial surveying company. I have a powerline dataset for an entire state that we need to survey. The lines in the dataset are not always connected. I need to determine an optimum flight plan that will minimize travel time and flying over a line more than once. I have 1 starting point (our office). I looked into a network analyst but as the lines are not connected, I cannot use this feature. Someone suggested connecting the lines manually, but there are around 500 line features in the dataset.

I recently downloaded ArcGIS 10.3.1 with all of the extensions.


texts: Is there a way to use ancient cities data with OSMnx?

texts:
Is there a way to use OSMnx to construct graphs and images of ancient street maps, perhaps using a data source similar to OSM (in the spirit of OHM)?

For example, is there a way to construct such a map of say, Tudor London, or ancient Athens?


texts: Determine parameters accepted by GeoServer

texts:
I'm looking for a way to determine which parameter arguments the GeoServer URL takes.

I can, by using owslib determine which requests I can do, but I also need to find out which parameters the GeoServer service accepts, among some examples of parameters are:

BBOX
srsName
version


texts:
I downloaded data from OSM and extract lat/lng coordinates from a user who is clicking on a leaflet map. So my program returns the coordinates where a user clicked!

I am wondering what crs I need to assign them?

As stated here and here there are two possible choices.

OSM

What I see on the screen is Web Mercator (EPSG 3857). The data I download from OSM is in WGS84 (EPSG 4326)?

Leaflet

Everything in Web Mercator (EPSG 3857)

What I am wondering is what CRS I need to assign to the downloaded OSM data and the data I get returned in my program from leaflet.


texts:
I'm a Remote Sensing PhD student, and as such I have a large number of satellite images that I'm working with. I'm starting to fail to keep track of them all and I have a lot of metadata that I want to track for each image (sensor, resolution, processing steps, format, source etc).

I have been using the SPECCHIO database for storing Spectral Libraries for a while, and was wondering whether anything similar exists for storing images. I've had a search and can't seem to find anything, but that doesn't mean that it doesn't exist!

Ideally I'm looking for something which can store a database of metadata and allow you to search for images that meet certain criteria (spatial resolution > 10m, or includes a certain lat/long co-ordinate).

Does anyone know if anything like this exists?

If it doesn't exist then I might have a go at writing something, which may involved SQLite, ENVI, IDL and a lot of late nights...


texts: Create Moveable InfoWindow without a Map ID

texts:
I have looked at examples showing how to create a moveable infowindow but all of them that I have seen require a Map ID. My application is not on Portal or ArcGIS Online and does not have a Map ID. I am sure there is a simple go-around but I have not been able to think of it.

I have been modifying this code but have been unsuccessful:

    require:([
'esri/arcgis/utils',
'dojo/dnd/Moveable',
'dojo/query',
'dojo/on',
'dojo/dom-class'

], function (arcgisUtils, Moveable, query, on, domClass){
    var webMapItemID = featureLayer10;
    arcgisUtils.createMap(webMapItemID, "map", {}).then(function(response) {
        var map = response.map;
        var handle = query(".title", map.infoWindow.domNode)[0];
        var dnd = new Moveable(map.infoWindow.domNode, {
            handle: handle
        });

        // when the infoWindow is moved, hide the arrow:
        on(dnd, 'FirstMove', function() {
            // hide pointer and outerpointer (used depending on where the pointer is shown)
            var arrowNode =  query(".outerPointer", map.infoWindow.domNode)[0];
            domClass.add(arrowNode, "hidden");

            var arrowNode =  query(".pointer", map.infoWindow.domNode)[0];
            domClass.add(arrowNode, "hidden");
        }.bind(this));
    });
}),

I have tried using a featureLayer, serviceLayer, url for app and the name for the file. My application is built in ASP.NET and is using Javascript, HTML and CSS. The layers are hosted on an ArcGIS Server 10.5. I am using Visual Studio Professional 2013.


texts: Python not installed in windows based QGIS on a Mac running Parallels

texts:
I'm operating a Mac Air running Parallels so I can use some Window based products. I have QGIS 2.18 installed as this has the ECW viewer as part of the system, allowing me to view aerials - this does not come as part of the Mac version of QGIS.
Each time I open QGIS I get the following message, which means I have no access to the Python plugins which are essential for some work

Couldn't load SIP module.
Python support will be disabled.

Traceback (most recent call last):
  File "", line 1, in
ImportError: No module named sip
Python version:
2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]

QGIS version:
2.18.20 'Las Palmas', e8e15d5b1e

Python path:
['C:/OSGeo4W/apps/qgis-ltr/./python', u'C:/Users/Eric/.qgis2/python', u'C:/Users/Eric/.qgis2/python/plugins', 'C:/OSGeo4W/apps/qgis-ltr/./python/plugins', 'C:\OSGeo4W\apps\Python27\lib\site-packages\setuptools-0.9.8-py2.7.egg', 'C:\OSGeo4W\bin\python27.zip', 'C:\OSGeo4W\apps\Python27\DLLs', 'C:\OSGeo4W\apps\Python27\lib', 'C:\OSGeo4W\apps\Python27\lib\plat-win', 'C:\OSGeo4W\apps\Python27\lib\lib-tk', 'C:\OSGeo4W\bin', 'C:\OSGeo4W\apps\Python27', 'C:\OSGeo4W\apps\Python27\lib\site-packages', 'C:\OSGeo4W\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg', 'C:\OSGeo4W\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win32.egg', 'C:\OSGeo4W\apps\Python27\lib\site-packages\win32', 'C:\OSGeo4W\apps\Python27\lib\site-packages\win32\lib', 'C:\OSGeo4W\apps\Python27\lib\site-packages\Pythonwin', 'C:\OSGeo4W\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win32.egg', 'C:\OSGeo4W\apps\Python27\lib\site-packages\wx-2.8-msw-unicode']

Sorry bit i am a front end user and don't know or fully understand the coding required copy and paste python into the system.

Can anyone provide some advice or point to clear advice on how to resolve this?


texts: How do I present labels in raster format in ArcMap 9.3?

texts:
I'm creating a raster map of a large city in ArcMap 9.3 which will be used in a third party software.  My problem is that I need to find a way to include labels of street names in my output.  I have a shapefile containing the roads of interest, which I can convert to raster for export to the third party software.  However, I can't figure out how to convert the street name labels to raster as well.

I'd like the labels to be small (i.e., readable at about 1:20k scale) so they don't clutter up the map too much when it is zoomed out.  The best "solution" I have come up with so far is to turn on and adjust the labels correctly, then export the map as a geoTIFF.  The drawback is that I can only seem to export the visible extent of my file.  Following this workflow, I'd export the sections individually, then mosaic them together into a new TIFF, with labels.  Is there a better way of doing this?

Also, the third party software has the capability to read shapefiles.  So, my other thought was to somehow convert the labels to polygons, which could then be overlaid on the raster map in the third party software to provide the label functionality.  However, I can't seem to get that to work either.

If anyone has any thoughts or advice, I'd be very grateful.  Thanks in advance.


texts: Is it possible to georeference an existing, un-georeferenced pdf?

texts:
I was wondering if there was anyway to georeference a pdf directly without first converting it to an image. I have access to ArcGIS 10.1 but haven't been able to find any information that would indicate it is possible. I am willing to try other open source software if they have a solution.

I receive site plans in PDF form, often generated from AutoCAD. Currently I save the pdf as a jpg to import into ArcMap, geo-reference it, and then digitize things like building footprints. I'm just wondering if there is a way to skip the conversion to jpg step.


texts:
From what I can tell python at ArcGIS Desktop 10.0 cannot create new textElements nor GraphicElements. Yet, 10.1 seems to support the ability to at least create a clone, of a existing GraphicElements, but not create one from scratch.

Can someone confirm this?

Does anyone know of any workaround to create a textElement from scratch?


texts:
I have a dataset with ranked attributes(e.g. very low, low, moderate, high, very high). I would like to write a python code using arcpy to give a numeric values to each rank, such as 0,5,10,20,50,100. I created a new field to save these values, and I am now struggling to write a simple code that translate each rank to a numeric value.
any ideas ?


texts: Using Python script to create map from external source via ArcGIS for Server?

texts:
Is it possible in ArcGIS Server to write a python script to pull features from a third party database in real-time?

Essentially I want to create a service where I can pass in filter parameters (BBOX, along with field queries ( ie...where car = 'Honda') via a service.

My python script would query my external database and create features/(Possibly a heat map) and return an image (wms) to the user.

I will have lots of data (in low millions) so I want to generate an image/heat map on server side and return to user.

Is this what a geoprocessing script would be?

The database is highly optimized and I can pull 2 million records in a second so I'd like to be able to have real time images generated (ie...as user pans and scrolls, my python script runs and pulls new data/image)

Essentially I want to have a custom "data store" utilizing python where I can serve out WMS?


texts: Does Bing maps silverlight API work on Windows phone 7?

texts: Has anyone seen any good resources on using Bing Maps Silverlight APIs on WP7?


texts: Vessel Tracking service in qgis or standalone

texts: I'm looking for a Vessel Tracking service to add it in Qgis or a standalone service. I'm interested in adding a layer above the map who does tracking  the vessels.  I find this https://www.marinetraffic.com/en/ais-api-services/documentation/api-service:ps02 but i'm don know if I can or how to add the API in Qgis.


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


texts: GME - Difference in Turn Angle and Bearing

texts: When using the movement.pathmetrics tool in GME, I get an out put table of turn angle and bearing. Can someone clarify as to what the difference between the turn angle and the bearing field is?


texts: How do I split polygons that cross the dateline?

texts:
I have a dataset of country borders which I obtained from:

http://thematicmapping.org/downloads/world_borders.php/

I have that dataset in both shp and SQL, but I'll put out there that I don't feel that affects my problem; however, please let me know if it does/can.

Because I'll be displaying those borders in something that uses Google Maps, I've got a problem. That problem is that countries whose polygons cross 180 degrees are displaying extremely weird in Google Maps. Either it's splitting them completely wrong, taking them all the way across the map, whatever the weirdness might be.

So, I thought I can simply address this by splitting the polygons of the countries that cross the line so that no country contains a polygon that presents a problem. Examples of such countries/regions would be Russia and Antarctica.

I therefore invoked the following:
ogr2ogr -wrapdateline -t_srs EPSG:4326 new countryBorders.sql

I got:
ERROR 1: TopologyException: found non-noded intersection between LINESTRING (-59.7742 -72.9003, -59.8494 -73.2331) and LINESTRING (0 -73.1221, -89.3211 -73.0542) at -59.8141 -73.0766
ERROR 1: TopologyException: found non-noded intersection between LINESTRING (-59.7742 -72.9003, -59.8494 -73.2331) and LINESTRING (180 -73.2589, -89.3211 -73.0542) at -59.8141 -73.0766

A few questions:

1: am I even doing this the right way? for example, I find it odd that I have to provide ogr2ogr the same srs as of the input. Is that translation even needed? Is that even the right SRS to use? I obtained that SRS from taking the .prj file and looking it up on this site:

http://prj2epsg.org/search

2: all I want is for a few of the polygons of those few troublesome countries to get split so they don't cause any more problems. -wrapdateline seemed like the perfect solution ... maybe it's not?

I'm completely open to advice, suggestions, references, whatever.

I am perfectly willing to redo this dataset in another projection, run a one-time query against it to redo it so it is more compatible with displaying on Google Maps, anything at all. I'd love any advice. It doesn't have to involve my most probably incorrect approach outlined above.

Thanks so much in advance!


texts: Using 'dynamic' default value in QGIS custom form

texts:
I am trying to make a custom form in QGIS to smoothen the digitizing process. For this purpose, I put the Edit widget (Layer properties, fields) of one of the fields on 'value map', and I loaded a .csv file containing a list of names. This works fine; values from the list can now be selected when a point is digitized.
However, to make things faster, I would like the form to 'remember' the last value selected from the list and to use this value as default for the next digitized point(s) until a new name is chosen from the list at some point in the digitizing process (and then to stick to that value until a new one is chosen, etc.).

How do I fix this?


texts: Why are some places missing from US Census Gazetter data?

texts:
I'm looking at the file I downloaded from the US Census here (2010 Census Gaz Places data), and I notice that a lot of cities are missing. For example, Montague, MA is completely missing. However, I see on their FactFinder site here that they collected data on the town in the 2010 census. Is Gazatter data incomplete, or am I looking at the wrong data?

damaya@deepthought:~/database_stuff$ grep Montague Gaz_places_national.txt
CA  0648690 02411140    Montague city   25  A   1443    633 4604514 39459          1.778           0.015     41.727088  -122.530511
MI  2655100 01626757    Montague city   25  A   2361    1182    6617559 1839755        2.555           0.710     43.413308   -86.364269
TX  4849032 02586961    Montague CDP    57  S   304 135 3304589 0          1.276           0.000     33.665270   -97.720954

damaya@deepthought:~/database_stuff$


texts: Is there recommended true type font for search and rescue?

texts:
Has anyone run across a true type font set to use for search and rescue cartography, and/or fire cartography?

This is specifically for Terrain Navigator Pro which isn't really a GIS application but can make use of true type fonts, which could be also used in QGIS which we use to make maps, since TNP doesn't have the same functionality.

Why what we're using is less than ideal: 1) we need to use TNP since it is much better suited for SAR missions than any heavyweight GIS application, and 2) the symbols and system fonts that come with TNP aren't specific enough for our needs.


texts: How to set code for designer legend in mapbasic

texts:
last couple of days i am doing work on thematic maps using mapbasic. I am getting error while set the legend code. it giving me unrecognized command or code kind of error ...

my code is

Create Designer Legend From Window nMID
Portrait Default Frame Title "# Legend" Font ("Arial",0,10,0)
Default Frame Style "%" Font ("Arial",0,8,0)
Frame From Layer 2 Using column object label default Frame From Layer 3 Using column object label default Frame From Layer 1

it giving error for Create Designer legend.....
does anybody knows this.....???

BTW...happy new year to all


texts:
This question has been asked for QGIS 2 and it was poorly answered.

I have my API key from Thunderforest for accessing the OSM maps. I am trying to use the 'OSM TF outdoors' map. It requires an API key. But I have no idea where to put the url that contains my API key. The options that existed in QGIS 2 are either not there, or the answers are too vague to properly lead me to where I need to be.

I obtained the Thunderforest map through QuickMapServices

Does anyone know where to place OSM TF API keys in QGIS 3?


texts: GeoPandas intersect not working as expected

texts:
Using GeoPandas 0.4.0 with Python 3.5, I'm finding that geopandas.intersects does not behave as I expect it to. For example, a buffer around Switzerland does not appear to intersect with neighbouring countries.

import matplotlib.pyplot as plt
import geopandas as gp

>>> world = gp.read_file(gp.datasets.get_path('naturalearth_lowres'))
>>> eur = world.loc[world['name'].isin(['Switzerland','Austria', 'Germany', 'Italy', 'Slovenia']),  ]
>>> ch = world.loc[world['name'] == 'Switzerland', ]
>>> buff = ch.buffer(1)

>>> eur.intersects(buff)
9      False
28      True
41     False
79     False
150    False
dtype: bool

Ie, the buffer only intersects with index 28 from eur, which is Switzerland. But the buffer clearly overlaps with the other countries as well, as demonstrated when plotting:

>>> fig, ax= plt.subplots()
>>> ax.set_aspect('equal')
>>> eur.plot(ax=ax)
>>> buff.plot(ax=ax, color='red'

What am I doing wrong that's preventing me from seeing the buffer intersecting with the other countries?


texts: How to extract pixel value counts from a raster in QGIS, in different polygons?

texts:
I have a raster with values from 1 - 12 (0 is no data) that has the extent of Sweden. These values represent factors, or categories rather then a numeric value. I would like to know how many of each factor there is in each of Swedens regions, which i have in a polygon layer. Can this be done without chopping up my raster in to 21 (or 12) peices? Zonal statistics will give me some statistics based on a polygon layer, but not the count of different values. r.stat and r.report will give me the output that i'm interested in but only across the entire raster. Is there a tool that will do both at the same time? Give me the count of each value in each region?

What i'm trying to do is exactly what is asked about here but not for the entire raster.


texts: Setup QGIS Display name to return only unique values from a search

texts:
In QGIS I am trying to setup the Locator to return matching Street Entry from the attribute table as opposed to all matching without creating a new merged layer. In the Display Expression I tried using the collect function as follows
 collect($geometry,"STREET_NM")

As well as a few variations of this including collect_geometries and line_merge. If I do the search as just STREET_NM every line segment with that street name is returned; I only want 1 return and the geometry to be all the line segments matching that return. Is there an Expression that can perform this function?