texts: Trajectory Indexing: How could I store and index the large trajectory dataset generated by cars' GPS?

texts:
I have a large trajectory dataset generated by cars' GPS. Since I will do some data mining work on them, I need an efficient way to store and index them.
I read some papers about Trajectory Indexing (Computing with Spatial Trajectories, by Yu Zheng and Xiaofeng Zhou, Microsoft research Asia), 3D R-tree, TB-tree(Trajectory-Bundle tree), SETI(Scalable and Efficient Trajectory Index) were proposed to solve this problem. But it is quite difficult to implement them.
Is there any implementation on this problem?

I am not quite familiar with POSTGIS. It has R-tree, but trajectories have a "time" dimension.
Could I expand postGis to index trajectories? How?

Truely grateful for all anyone's help!

1,2000 taxis' trajectories for one month. About 50GB. latitude,longtitude,time. I need to search for trajectories of regions during anytime, and so on.


texts:
I have 5 layers:

NAM_USA (It has four fields of our interest, named 'bare', 'sand', 'woody' and 'built' depicting feature counts in each of the below corresponding layers.)
Baresoil
Woodyland
Sandbeach
Builtup

The process is :

Jump to a feature(grid) in NAM_USA using go2nextfeature plugin.
Calculate predefined expressions on NAM_USA fields 'bare', 'sand', 'woody' and 'built'. The calculated values are before step 3 feature counts in layers 'Baresoil', 'Sandbeach', Woodyland' and 'Builtup' respectively.
Make new features in layers 'Woodyland', 'Sandbeach', 'Baresoil' and 'Builtup' if any.
Press "go to next feature". Now, before jumping to next grid tile, the plugin AutoField will execute some expressions on rest of the fields of NAM_USA based on the calculated values of 'bare', 'sand', 'woody' and 'built' in step 2 and current values.

At present I have to calculate expression on all four fields individually in step 2.

What I want : Calculate expression on all four fields in step 2 in a single click.

Is there any method or plugin or script by which I can reduce the efforts of calculating individually?

I do not have good knowledge of PyQGIS.


texts: Expand raster nodata area (shrink values area)

texts:
I need to fix a raster that's been inappropriately resampled along the nodata edge. The bad data area is narrow, pretty much a single cell. The value range is too variable to use a simple "erase less than 20" kind of logic. How can I fix this?

I'm partial to a GDAL command line utilities or QGIS solution, but anything goes.

In the past I've used Gimp or Photoshop for this (magic wand select nodata with 0 tolerance, expand selection by 1 or 2px, delete, save, restore georeferencing), but I can't do that here. The image is 16bit (a DEM) which photo tools don't handle well (Gimp not at all) and at 4gb the image is too large to manage comfortably anyway.

In figure 1 black is the bad data to be removed, in figure 2 black is to be retained, but it's acceptable to lose 1 or 2 pixels.

Update: figure 3 close up showing cell values. A de-collaring tool like nearblack doesn't work because bad values are within valid value range, and often nowhere near black or white.

I've put samples from the dataset here:
http://files.environmentyukon.ca/matt/gis-stack/expand-raster-nodata-area/

Update 2: remove Gdal/Qgis focus.


texts: Generating WMS from PostgreSQL table with GeoServer in phpfile?

texts:
I've a PostgreSQL table build from shapefile. In my phpfile I duplicate this table with a new name.

Now I want to generate a WMS with the content of the new table. The generation must be automatically in code of the phpfile not manually in GeoServer.


texts:
I was asked to create a feed for a company. Are there any tools I can use or do I have to make the entries one by one,line by line?

What are the tools big agencies use?


texts:
I'm trying to make some markers spinnable using this :

target = document.getElementById("mapid");
target.ondragover = function(e){
    e.preventDefault();
    e.dataTransfer.dropEffect = "move";
};

target.ondrop = function(e){
    e.preventDefault();
    imagePath = e.dataTransfer.getData("text/plain");
    coordinates = mymap.containerPointToLatLng(L.point([e.clientX,e.clientY]));
    L.marker(coordinates, {icon: L.icon({iconUrl: imagePath, iconSize: [60,40]}),draggable: true}).addTo(mymap);
};
var angle = 0;
var width = 60;
var height = 40;

$(document).keydown(function(e){
    if(e.which == 65){angle-=5;left();angle = 0;}; //"A" key
    if(e.which == 69){angle+=5;right();angle = 0;}; //"E" key
    if(e.which == 83){height+=5;bigger();}; //"S" key
    if(e.which == 90){height-=5;smaller();}; //"Z" key
    if(e.which == 81){ width-=5;thinner();}; //"Q" key
    if(e.which == 68){ width+=5;wider();}; //"D" key
    if(e.which == 87){ $('.leaflet-marker-icon').attr('id', 'rotate');}; //"W" key
    if(e.which == 88){ $('.leaflet-marker-icon').removeAttr('id');}; //"X" key
});

function left(){document.getElementById('rotate').style.transform += "rotate("+angle+"deg)";};
function right(){document.getElementById('rotate').style.transform += "rotate("+angle+"deg)";};
function smaller(){document.getElementById('rotate').style.height = height + 'px'};
function bigger(){document.getElementById('rotate').style.height = height + 'px'};
function wider(){document.getElementById('rotate').style.width = width + 'px'};
function thinner(){document.getElementById('rotate').style.width = width + 'px'};

PROBLEMS :

Only the first dropped marker can rotate, readjusts its size
I can rotate my marker as I want, it will now stays in place, but If I drag the icon around, zoom/unzoom the map, the rotate(Value) will be gone forever.

What I've tried and didn't work:

replace the ID with some sort of class (makes ALL the elements adjustable at the exam same time)
a keybind to remove the ID from the current marker (after a new marker is dropped, the ID will be set for the first one)

What I want: multiples markers that can rotate, and modify their size.

UPDATES: I found why my marker keeps losing thr rotate function when dragging it, zooming in/out, it's simply bcz these actions are modifying the translate3d values, thus removing the rotate style


texts:
I want to be able to set and change Openlayers.Map options after construction, but my results are not expected. Can anyone point out problems with my approach or suggest better way if possible?

http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html#OpenLayers.Map.OpenLayers.Map

var map = new OpenLayers.Map('map');
map.options = {
                projection: 'EPSG:3112',
                displayProjection: 'EPSG:4326',
                units: 'm',
                maxExtent: new OpenLayers.Bounds(-3237313.46,-5312745.84,3019649.82,-876762.78),
                resolutions: [12288,6144,3072,1536,768,384]
                };


texts: Merging/dissolving all polygons adjacent to each other using ArcGIS Desktop?

texts:
I have a shapefile containing a lot of polygons, that share boundaries or just single vertices, for diagonal polygons.

I'm trying to merge/combine all the polygons that share a boundary.

I've tried using Dissolve followed by a Multipart to Singlepart, however this splits up polygons that share a vertice (see purple polygons). Also the top left part of the purple polygons aren't merged either.

Is there a way to make it so, if a polygon touches boundary with another polygon (using D8 method, so all 8 directions from a cell), it should be merged.


texts: Cost_Matrix Distance: Vehicle routing problem!

texts:
I'd like to calculate the "real distance" between one source and many targets, such as we do in the "vehicle routing problem", in order to get the matrix distance at the end.

after using the osm2po, and loading the topology into QGIS, and installing pgrouting plugin:

How could I do this cost matrix with the Pgrouting/QGIS? to get a result such as in like in
points are {1,2,3}, the problem is asymetric

1---1=0
1---2=2
1---3=4
2---1=5
2---2=0
2---3=21
3---1=5
3---2=4
3---3=0

knowing that almost the functions found in Pgrouting are for calculating the shortest paths, and the function "tsp_euclid" doesn't return a result in my case.


texts: How to create turn-by-turn directions from a generic polyline route?

texts:
I have some polyline data that represents a navigation route generated using Dijkstra's algorithm. Along this route I would like to calculate anytime a turn is required. Ideally, this would be some threshold where the route would require a turn greater than X amount.

Given a polyline, what are some techniques to calculate a turn and it's direction?

Bonus if any code samples are in C# or other C-style languages.

EDIT: Additional information to narrow the question down:

I am not using road data. The data is custom captured coordinates for a travel path. This means I can't use something that consumes road networks like from OSM data.

I believe I am looking for mathematical techniques to calculate the turns in my custom data. For example, I am currently using two segments of my path. Point1 -> Point2 and then Point2 -> Point3. With these two vectors I am trying to determine if there is an angle in direction change that could be considered a "turn". I am not sure of all the variables I need to take into account here with heading/bearing, etc. Any explanation of what to consider would help.


texts: How to name/call functions in OpenLayers2?

texts:
I don't know well enough OpenLayers syntax, so I need to ask here. I need to name every function in OpenLayers (for creating map - tiles, for drawing markers on the map etc.). So, I have this simple code:

map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0?", {layers: 'basic'});

I would need to put that inside the function and name that function, something like this:

function createMap() {
    map = new OpenLayers.Map('map');
    var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
    "http://vmap0.tiles.osgeo.org/wms/vmap0?", {layers: 'basic'});
               }

createMap();

But that code doesn't work. So, can you tell me if this is possible and why my code doesn't work?


texts:
I'm trying to run a WPS process on a GeoServer instance using OpenLayers WPSClient. One of the parameters of the process is a raster layer. How do I pass this to using the WPSClient?
 The documentation indicates how to call this with vector data, but I can't seem to figure out how to do it with raster data.


texts: Reset map zoom based on added layers in Folium

texts:
I have a folium map object that I am displaying in a notebook and adding layers to it and displaying again.
So I want to update the zoom level of a map each time I add a layer based on the extent of these layers and previously added layers.
I know I can create a FetureGroup and do FitBounds but I don't want to have a FeatureGroup. Is there a way to do this automatically?


texts: Using Non-commercial license of ArcGIS for Desktop to undertake Proof of Concept?

texts:
in our company we are using QGIS for any GIS related analyses. However I really want my boss to invest in ArcGIS because I believe its a lot more functional and stable than OpenSource solutions.

However I only own a non-commercial version of ArcGIS that I use at home for online courses. I thought about reworking one of our former projects in order to convince my boss of the advantages and make him investing into ArcGIS.

The question: Am I actually allowed to do this with a non-commercial version? I am really careful about anything related to copyright issues, so I thought I better ask beforehand. I do not intend to sell any of the data to anyone.


texts: Adding missing python packages to QGIS Plugin?

texts:
In our plugin, we dependent on some external python packages. Some are available in QGIS, some (like pandas or fiona) are not.

I've written small script, which checks requirements and if something is missing, it is automatically installed.

install_deps.py:

import pathlib
import sys

plugin_dir = pathlib.Path(__file__).parent.parent

try:
    import pip
except ImportError:
    exec(
        open(str(pathlib.Path(plugin_dir, 'scripts', 'get_pip.py'))).read()
    )
    import pip
    # just in case the included version is old
    pip.main(['install', '--upgrade', 'pip'])

sys.path.append(plugin_dir)

with open(str(plugin_dir / 'requirements.txt'), "r") as requirements:
    for dep in requirements.readlines():
        dep = dep.strip().split("==")[0]
        try:
            __import__(dep)
        except ImportError as e:
            print("{} not available, installing".format(dep))
            pip.main(['install', dep])

In the main file of python plugin, I just have import install_deps and missing modules are pip-installed automatically.

Disadvantage is, that this short "check" is done every time QGIS is starting  (with the plugin activate).

Not sure, if there is better approach, than this?


texts: Importing shapefile in Google Earth, CRS problem

texts:
I have a line shapefile in QGIS, my project and layers CRS is MGI 1901 Balkans zone 7.

When I import it in Google Earth it is misplaced a little. I understand that Google Earth is in UTM and mine is in TM, so how can I solve this and have it placed correctly?

Here are screenshots of data properties and export dialogue


texts: Is it possible to query a geopackage (.gpkg) for features within a given bounding box?

texts:
I have GIS data with a very large layer stored within a geopackage from where I want to select features that fall within a bounding box calculated in my R session. I begin by creating a query string:

query<-"SELECT * FROM buildings where ST_Intersects(geom, 'SRID=3006; POLYGON((753028 , 7084328, 764500,7093410))');"

Then I use it in an st_read call:

buildings<-st_read(dsn="database.gpkg",layer="buildings", query=query,driver="GPKG")

The result is the entire layer, and not the subset that I had intended. Is there anything else I have to do in order to be able to run these spatial queries?

EDIT: I have also tried a different version of the query:

query<-"SELECT * FROM buildings where ST_Intersects(geom, ST_GeomFromText( POLYGON((753028 , 7084328, 764500,7093410))',3006)));"


texts: OpenLayers icon interaction: feature.get(...).getImage is not a function

texts:
I try to add a hover and click interaction to the points (displayed as marker icons) I show in my map. I want to display a border around the icon that is selected/hovered. I started by using the OpenLayers example and found a question on stackoverflow covering exactly my concern. So I built my function based on those examples, but if I hover over a marker the console gives the error feature.get(...).getImage is not a function. I can't find any solution to my problem.
I use a switch statement to assign every point in my map a specific SVG-icon (standard style, without interaction):
function stylePoint(feature, resolution) {
switch(feature.get('type')) {
case '1':
    icon = '.../1.svg';
    break;
case '2':
    icon = '.../.2svg';
    break;
}
return [new ol.style.Style({
    text: new ol.style.Text({
        font: '10px bold Calibri',
        text: resolution < 40 ? feature.get('number') : '',
        offsetX: 10,
        offsetY: -15,
        textAlign: 'top',
        fill: new ol.style.Fill({color: 'rgb(0,0,0)'}),
        stroke: new ol.style.Stroke({color: 'rgb(255,255,255)', width: 2.5})
    }),
    image: new ol.style.Icon({
        src: icon,
        scale: 0.025
        })
    })
];
};

So this works perfectly as intended. I then added the interaction:
var selectClick = new ol.interaction.Select({
  condition: ol.events.condition.click,
  layers: [point],
  style: highlightPoint
});
var selectHover = new ol.interaction.Select({
  condition: ol.events.condition.pointerMove,
  layers: [point],
  style: highlightPoint
});
map.addInteraction(selectClick);
map.addInteraction(selectHover);

The interaction refers to another style function (the one that should apply on hover and click):
function highlightPoint(feature, resolution) {
switch(feature.get('type')) {
case '1':
    icon = '.../1.svg';
    break;
case '2':
    icon = '.../2.svg';
    break;

feature.set('style', stylePoint);

var image = feature.get('style').getImage().getImage();
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
var activeColor = "red"; //set border color
var dArr = [-1,-1, 0,-1, 1,-1, -1,0, 1,0, -1,1, 0,1, 1,1], // offset array
    s = 2,  // thickness scale
    i = 0,  // iterator
    x = 2,  // final x position
    y = 2;  // final y position

//set new canvas dimentions adjusted for border
canvas.width = image.width + s + s;
canvas.height = image.height + s + s;

// draw images at offsets from the array scaled by s
for(; i < dArr.length; i += 2)
ctx.drawImage(image, x + dArr[i]*s, y + dArr[i+1]*s);

// fill with color
ctx.globalCompositeOperation = "source-in";
ctx.fillStyle = activeColor;
ctx.fillRect(0,0,canvas.width, canvas.height);

// draw original image in normal mode
ctx.globalCompositeOperation = "source-over";
ctx.drawImage(image, x, y,image.width, image.height);

return [new ol.style.Style({
    text: new ol.style.Text({
        font: '10px bold Calibri',
        text: resolution < 40 ? feature.get('number') : '',
        offsetX: 10,
        offsetY: -15,
        textAlign: 'top',
        fill: new ol.style.Fill({color: 'rgb(0,0,0)'}),
        stroke: new ol.style.Stroke({color: 'rgb(255,255,255)', width: 2.5})
    }),
    image: new ol.style.Icon({
        src: icon,
        scale: 0.025,
        img: canvas,
        imgSize: canvas ? [canvas.width, canvas.height] : undefined
    })
}),
];
};

So most of the code is basically copy + paste from the StackOverflow question. But I already get stuck in the line var image = feature.get('style').getImage().getImage(); and I don't understand why. The keyword style refers to my style function. And if I print feature.set('style', stylePoint); in the console I get the style function stylePoint (as it should be I think).
I use OpenLayers 6.5.0.


texts: I am trying to convert a GeoTiff file to ASCII format. After conversion I am getting all pixel values in ASCII file to be NoData value. How can I get the pixel values in ASCII file? Pixel values however are being shown while viewing the raster file in QGIS


texts: How to register onclick handler for *all* KML feaures in OpenLayers?

texts:
I'm a newbie using OpenLayers with JQuery to display vector data from KML files. I'm creating the layer like this:

newlayer = new OpenLayers.Layer.Vector( layerid, {
    projection: MAPVAR.displayProjection,
    strategies: [new OpenLayers.Strategy.Fixed()],
    protocol: new OpenLayers.Protocol.HTTP({
        url: layerurl,
        format: new OpenLayers.Format.KML({
            extractStyles: true,
            extractAttributes: true,
            maxDepth: 2
        })
      })
    });

I want to avoid using these vector features with the OpenLayers.Control.SelectFeature control. Instead i would like to have each svg feature respond to a click event and pop open their own individual windows with the attributes.

I'm having trouble figuring out how to add the onclick function to ALL the vector features loaded.

For example, I can attache a function to the KML layer's "loadend" event and add the onclick function doing the following:

$('g[id$=vroot] > *').css("cursor", "pointer")
$('g[id$=vroot] > *').click(function(evt){ $w = $.WM_open(); $w.find('.windowcontent').append("SUCKER"); });

But this will only apply the handler to those vector elements in the view extent and not the ones that are waiting to be rendered in the HTML. I'm not sure how to access the unrendered ones -- they are in the DOM.

I've come up with really stupid stupid work around to this problem, but I know there has to be a better way.

Is there some way I can dynamically create the "onclick" handler for each svg feature when they are getting parsed? Would that require me to subclass OpenLayers.Layers.Vector or OpenLayers.Formats.KML? Does anyone have an example? Or recommendation on other ways?

thx
mazery

I still have not solved adding the onclick handler to the features. But i was able to override OpenLayers.Format.KML parseData() to add a pointer cursor to the feature styles before the loadend runs on the KML layer (additions demarcated with * EDITS *).

var FormatErmaKml = OpenLayers.Class(OpenLayers.Format.KML, {
parseData: function (data, b) {
    typeof data == "string" && (data = OpenLayers.Format.XML.prototype.read.apply(this, [data]));
    for (var c = ["Link", "NetworkLink", "Style", "StyleMap", "Placemark"], d = 0, e = c.length; d < e; ++d) {
        var f = c[d];
        var g = this.getElementsByTagNameNS(data, "*", f);
        if (g.length != 0) switch (f.toLowerCase()) {
        case "link":
        case "networklink":
            this.parseLinks(g, b);
            break;
        case "style":
            this.extractStyles && this.parseStyles(g, b);
            break;
        case "stylemap":
            this.extractStyles && this.parseStyleMaps(g, b);
            break;
        case "placemark":
            this.parseFeatures(g, b)
        }

    }
    **** EDITS BEGIN ****
    for(var count = 0; count < this.features.length; ++count){
            f = this.features[count];
            f.style.cursor = "pointer";
    }
    **** END EDITS ****
    return this.features
},});

Any ideas on adding the onclick handler for each feature are welcomed.

thx
mazery


texts: Shifting LiDAR point clouds that have been incorrectly georeferenced

texts:
I am new to LiDAR and have never been a part of the LiDAR data pre-processing stage and hence, this question. I have two LiDAR point clouds (.las files) of a densely forested area that were captured from two different sensors (A and B). Both of the point clouds have an offset due to incorrect GPS calibration during time of capture.

The only hint I have to correctly georeference the point clouds is with a known location of a carbon flux tower [let's say at (X,Y)m].

Would I be heading in the right direction to write a python script that could just correct the offset in the point clouds to match with (x,y)?


texts: Downloading raster from Natural Earth world raster directly into QGIS?

texts:
The world raster of Natural Earth can be downloading from their website.
Is their a way to download them directly into QGIS?


texts: Avoiding exclusive schema lock error with ArcPy?

texts:
I have a script for updating some features on my database every night (just for copying and replacing some features). This features are "read-only".
My problem is that I can't avoid that these features are opened by users, and my script can show the following error:

ExecuteError: ERROR 000464: Cannot get exclusive schema lock.
              Either being edited or in use by another application.

Can I force the phyton script, via some command, copying the files, even been opened by some user?
Can I take down all the connections on my database before running the script?


texts: Are PDAL or PCL capable of producing LiDAR grid metrics?

texts:
I typically use Windows-based FUSION to generate grid metrics, which can be used to describe forest structural characteristics. From the FUSION documentation:

  GridMetrics computes a series of descriptive statistics for a LIDAR
  data set. Output is a raster (grid) represented in database form with
  each record corresponding to a single grid cell.

FUSION and RSAC have excellent documentation and tutorials--for example, page 5 of EXERCISE 5: CALCULATE LIDAR METRICS highlights how to use FUSION to calculate grid metrics such as: count, skewness, cover, 75th percentile value for cell, etc... More details on grid metrics can be found on page 69 of the FUSION documentation.

In an effort to port my LiDAR processing to Linux and open source software, I am curious what functionality PDAL or PCL have for calculating grid metrics?


texts: PyQGIS - get spatial/positional order of featurelist

texts:
I would like to know if it is possible to sort a list of line features in the exact order in which they appear on the canvas, given the starting feature. In this case the list of linefeatures represents a connection from point A to point B passing by point C using line features from a layer as the possible route.

I used the points to route script (from here) to generate the new routelayer using a startpoint, endpoint and points to pass by. Unfortunately this generated routelayer does not contain information about underlying line features and their spatial order. For that I used geometry.contains() and geometry.overlaps() functions to get the original features from the underlying line layer. The problem with that is, there is no order to the line features.

The code for that is as follows:

selections=[]
for f in routelayer.getFeatures():   #iterating over route
    for a in originallayer.getFeatures(): #itering over all existing line features

        if f.geometry().contains(a.geometry()):
            selections.append( a )

        elif f.geometry().overlaps(a.geometry()):
            selections.append( a )

Here is a visual example of the problem:

The colored lines represent elements of selected features from the code above. Each feature has an ID as shown in the image. It's important to note that the IDs are not in any logical order, so sorting them doesn't achieve what I need.

My unsorted list looks a follows (example):

ID

4
56
10
8
15

I would like it to be in the correct order of line elements for the route from A to B.

ID

8
4
56
15
10

Anyone got an idea on how to solve this? If there is a way to get the correct order of underlying line features at the stage of generating the route it would also work.


texts:
I have a table of tiled rasters. They often overlap with each other. For instance:

I would like to eliminate the overlaps. Where a raster overlaps with another raster, it should take the larger value of the two.
I could do this, but it creates one giant raster, and is not tiled. Doing so on some of my datasets crashes PostGIS, so it is not an option.
SELECT  st_union(rast, 'max')
FROM    foreign_data.temp_geounits_raster

I want to maintain the tiled approach.
Can I use st_intersects to do this?


texts: Attribute objects in Enterprise geodatabase automatically

texts:
There is a Enterprise geodatabase (MS SQL Server, ArcGIS), it has about 100 feature classes. It is necessary to automate the process of populating a unique number to each object in the database. numbers should not be repeated in all database. I created a SQL trigger that successfully filled the number. But base settings are without flag "move edits to base", and the trigger does not work, because it goes through the delta table. When the flag is true triggers work well. But I shouldn't use this flag. Any ideas how to do this without triggers?

CREATE TRIGGER DBO.UNIQ_id
    ON DBO.LAND_POL
    AFTER INSERT
AS
BEGIN
    SET NOCOUNT ON;
    DECLARE @MAXCOUNTLAST AS INT
    DECLARE @MAXCOUNTNEW AS INT
    SELECT @MAXCOUNTLAST=MAX(IDC_MAX.IDC) FROM DBO.IDC_MAX
    SELECT ONJECTID, IDC, ROW_NUMBER() OVER (ODER BY OBJECTID) AS aID INTO #T1 FROM INSERTED WHERE (IDC IS NULL);
    UPDATE #T1 SET aID = aID+@MAXCOUNTLAST
    UPDATE DBO.LAND_POL SET IDC=#T1.aID FROM DBO.LAND_POL A INNER JION #T1 ON A.OBJECTID=#T1.OBJECTID
    SELECT @MAXCOUNTNEW=MAX(LAND.POL.IDC) FROM DBO.LAND_POL
    UPDATE DBO.IDC_MAX SET IDC = @MAXCOUNTNEW
END


texts: Where can I find latitude and longitude data for the borders of U.S. Congressional districts?

texts:
I'm interested in finding the most up-to-date latitude and longitude data for U.S. Congressional district borders.  I'd prefer a human readable format (e.g. XML), but I'm writing my own code so I can work with just about anything if the format is well-defined.  I only need the state, district, and the latitude and longitude points that define the borders for each district.

I need the borders for all U.S. Congressional districts.  Is this a dataset that I can download from somewhere all in one place?  Or do I need to track down the data for each state individually?  (Or even worse, each district?)


texts: Batch processing las files with LASzip from QGIS?

texts:
I am using QGIS 2.16 version. I added LAStools plugin and executed batch process, in a way that I have to write each filename in the output field. Is there any automatic process to get outputs with the same original name separately?

Also, I'm having to select each file one by one to provide the input file. How to provide multiple inputs if several .las files are available?


texts: Buffer ring problem with uses of make feature layer

texts:
Im trying to create a buffer ring shape but gets me the error 210:

  arcgisscripting.ExecuteError: ERROR 000210: Cannot create output
  C:\Trabajo Carto\TempPrograma\"capa de Ringbuff70".shp Failed to
  execute (Dissolve).

  Failed to execute (MultipleRingBuffer).

with open (nombarch3) as p:
for x in recortes2:
    dtaring = p.readline()
    arquet, valbuf2, datperm= dta.split(",")
    valbuf2=float(valbuf2)
    a= valbuf2*0.3
    b= valbuf2*0.5
    c= valbuf2
    distances = [a,b,c]
    c=str(x)
    arcpy.MakeFeatureLayer_management(outsal,'"capa de Ringbuff'+x+'"')
    arcpy.MultipleRingBuffer_analysis(outsal,'"capa de Ringbuff'+x+'"', distances, "meters", "", "ALL")
p.close
first = True
entrada = []
for x in recortes2:
    if not first:
        entrada=entrada+","+ '"capa de Ringbuff'+x+'"'
    else:
        first = False
        entrada='"capa de Ringbuff'+x+'"'
arcpy.Merge_management(entrada,bufferRings)


texts: Create warped image for Google KML using WGS84 coordinates, Python

texts:
First a disclaimer, I'm not very fluent in GIS language and terms, so apologies if I use wrong terms etc.
Task:
A couple of years ago, I had the task of making image overlays for google, using  UTM coordinates + color info. I did this by making a simple bitmap using the UTM coordinates and colored each pixel in the desired color. Then I transformed this image using gdalwarp.
gdalwarp -q -s_srs EPSG:32632 -t_srs EPSG:4326
Worked perfectly for our needs.
Problem:
Now I have the same task, but this time the info for creating the image files is given in WGS84 instead of UTM. How do I best accomplish this task. Do I convert WGS84 -> UTM, then do "as-last-time" or is there a more elegant solution for creating the image directly from WGS84?
Needs to be open source, preferably Python or Python/command, for automation.


texts: Validating shape type of input feature layers in Python Toolbox of ArcPy?

texts:
How can I get in explorer folder window a layer in specify shape?

For example allow:

How can We look, explorer after click INPUT FEATURES, shows a layers only points type.

How can I get validate effect like this?


texts: Fast zipcode detection from latitude/longitude

texts:
I need a way to get the zipcode of a lat/long pair fast (<10 ms), and at a high rate (thousands of qps)

I've loaded a shapefile from the US Census Bureau into a mysql database with spatial indexing and I've been using the following code to query it:

select
    zipcode
from
    geo.part
where
    ST_Contains(boundary,
            POINT(?, ?))
    LIMIT 1;

It works great, only I'm seeing response times between 20 and 100ms.

Do you have any suggestions to have it run faster?

A different stack? (postgres with postgis maybe?)

The shapefile had quite a lot of points per zipcode, I don't really need that much resolution. Would pruning those files make much of a difference (remove half of the points for each zipcode)?

Something else?


texts: ESRI/Mapinfo MGA56 prj vs QGIS MGA56 prj

texts:
I am trying to understand why the degree unit is different between ESRI/Mapinfo and QGIS:

ESRI/Mapinfo
PROJCS["GDA_1994_MGA_Zone_56",GEOGCS["GCS_GDA_1994",DATUM["D_GDA_1994",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",10000000.0],PARAMETER["Central_Meridian",153.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]

QGIS
PROJCS["GDA94_MGA_zone_56",GEOGCS["GCS_GDA_1994",DATUM["D_GDA_1994",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["Meter",1]]

I believe all software packages suggest I am using EPSG 28356. Is it possible that for a large spatial dataset, the small difference in units can lead to very slight shifts in the datasets?


texts: Cannot delete Feature Class, after having un-registered as versioned. The item does not have a definition

texts:
On our ArcGIS 10.7.1, we tried to unregister a Feature Class as not longer versioned. After this was done, we are unable to open the Feature Class:

We are also not able to re-register the Feature Class as versioned, again:

Our database is a Microsoft SQL Server 2016 SP2.

We also tried to delete the Feature Class, which gave the below error:

Any idea, of how we can get this Feature Class removed, so we can re-create it?

I have tried the following:

Diagnose Version Metadata
Diagnose Table Versions

None of these found any errors.


texts: Using Tilestache and Leaflet To Display Rasters In Native Projection

texts:
I have a collection of old Idaho state highway maps in GeoTiff format.  The projection that these maps have been georeferenced in is a transverse mercator projection, called IDTM83 (Idaho Transverse Mercator - NAD 83).  The projection is defined as:

  +proj=tmerc +lat_0=42 +lon_0=-114 +k=0.9996 +x_0=2500000 +y_0=1200000 +ellps=GRS80 +units=m +no_defs

The projection is basically a modified UTM projection that compensates for that fact that the state of Idaho is split by UTM zones 11 and 12.  My goal is to serve the maps in the native IDTM83 projection using Tilestache and Leaflet.  I am able to serve these same rasters that have already been projected into world mercator, but the the projection distorts much of the line work from the original map.

There have been some helpful resources on the internet on how to serve projected data using Tilestache and Leaflet, here:

https://gist.github.com/skogsmaskin/6452343
http://blog.thematicmapping.org/2012/07/using-custom-projections-with-tilecache.html.

The mapnik configuration for one of my raster maps looks like:

<Map background-color="steelblue"
srs="+proj=tmerc +lat_0=42 +lon_0=-114 +k=0.9996 +x_0=2500000 +y_0=1200000 +ellps=GRS80 +units=m +no_defs"
maximum-extent="2205517,1134032,2834671,2040323">
<Style name="raster-style">
  <Rule>
      <RasterSymbolizer/>
  </Rule>
</Style>

<Layer name="idaho-1947" status="on" srs="+proj=tmerc +lat_0=42 +lon_0=-114 +k=0.9996 +x_0=2500000 +y_0=1200000 +ellps=GRS80 +units=m +no_defs">
<StyleName>raster-style</StyleName>
<Datasource>
    <Parameter name="type">gdal</Parameter>
    <Parameter name="file">GIS/IdahoMaps/1947_geo_idtm.tif</Parameter>
    <Parameter name="format">tiff</Parameter>
</Datasource>
</Layer>
</Map>

Using Python, I am able to generate maps using bounding boxes from the IDTM coordinate system with the Mapnik API.  So I know that Mapnik is not the problem.

My Tilestache config is pretty basic:

    {
  "cache": {"name": "Test","verbose":"True"},
  "layers": {
    "idaho-1947": {
        "provider": {"name": "mapnik", "mapfile": "./mapnik.xml"},
        "projection": "TileStache.Goodies.Proj4Projection:Proj4Projection('+proj=tmerc +lat_0=42 +lon_0=-114 +k=0.9996 +x_0=2500000 +y_0=1200000 +ellps=GRS80 +units=m +no_defs',[5545984, 2772992, 1386496, 693248, 346624, 173312, 86656, 43328, 21664, 10832, 5416, 2708, 1354, 677, 338.5, 169.25, 84.625, 42.3125, 21.15625, 10.578125, 5.2890625, 1])"
    }}

My leaflet viewer is very basic, set up like on Link #2 above:

  var crs = L.CRS.proj4js('SR-ORG:6677', '+proj=tmerc +lat_0=42 +lon_0=-114 +k=0.9996 +x_0=2500000 +y_0=1200000 +ellps=GRS80 +units=m +no_defs', new L.Transformation(1, -432000, -1, 2040323));
  crs.scale = function(zoom) {
      return 1 / (234.375 / Math.pow(2, zoom));
  };

  var map = new L.Map('map', {
    crs: crs,
    layers: [
      new L.TileLayer('http://localhost:8080/idaho-1947/{z}/{x}/{y}.png', {
        minZoom: 0,
        maxZoom: 4,
        continuousWorld: true
      })
    ],
    center: new L.LatLng(45, -116),
    zoom: 3,
    continuousWorld: true
  });

I intend to refine this once I can get the maps to display, but the example is using UTM data and the scales should be pretty similar.  I am stuck here.  Using the JavaScript examples provided in both the links above, I cannot display any of the maps - only the lightblue background.  I know what I am trying to do is possible in ArcGIS Server, but I would really like to leverage some of the OpenSource tools.


texts: Openlayers WMS wrong show OSM, good for google maps

texts:
I have two maps one is OSM and one is google maps. I want show WMS with projection EPSG:2180 and when I switch layer to wms then features hidden and show border from WMS but wrong. When I set google map(ol3gl) then it's good to time when map crash - I can't zoom. I upload two images(there where is red, there is good)
Some code with WMS:

 proj4.defs("EPSG:2180","+proj=tmerc +lat_0=0 +lon_0=19 +k=0.9993 +x_0=500000 +y_0=-5300000 +ellps=GRS80 +units=m +no_defs");
var extent = [171700.190996, 140135.919877, 861883.198003, 774942.471876];
var proj=ol.proj.get("EPSG:2180");
proj.setExtent(extent);

var projection = new ol.proj.Projection({
    code: 'EPSG:2180',
    extent: extent
});
var WMS=new ol.layer.Tile({
    extent: extent,
    source: new ol.source.TileWMS({
    url: 'http://mapserver.bdl.lasy.gov.pl/ArcGIS/services/WMS_BDL/mapserver/WMSServer',
    crossOrigin: null,
    projection: ol.proj.get('EPSG:2180'),
    params: {
        'LAYERS': '3',
        'FORMAT': 'image/png',
        'TRANSPARENT':true,
        //'WIDTH':"1070",
        //"HEIGHT":"400",
    },
    serverType: /** @type {ol.source.WMSServerType} */ ('geoserver')
    })
});
//manager['main_osm'].setVisible(false);
//manager['main_google'].setVisible(false);
var _view=new ol.View({
    center: ol.proj.fromLonLat([0, 0], projection),
    zoom: 0,
    extent: [171700.190996, 140135.919877, 861883.198003, 774942.471876],
    projection: ol.proj.get('EPSG:2180'),
});
manager["wms"]=WMS;
map.setView(_view);
WMS.setOpacity(0.7);
map.addLayer(WMS);

Image bad:

Image with good result:


texts: I would like to know the way to overlay 50000 markers on OpenLayers, and would like to know how many OpenLayers can support?


texts:
As shown below my ArcToolbox icons have changed somehow, and I'd like to change them back.

Rebooting Arcmap helps but it will change back to folder icons after a while. How can I change them back?

I couldn't locate my Normal.mxt either. (ArcGIS 10.4)

Edit: apparently when I logged back in today, the error has ceased to appear so far. Restarting ArcGIS yesterday was no luck however. Not sure why, but will update if any issue arises.


texts: how to while true in thread for qgis plugin?

texts:
I am currently working on qgis plugin that searches for information every 5 seconds from database and refreshes the map. In my first version, I used Qtimer to do this job. However, in my second version I am thinking of using Qthread.

The example code is below:

Class worker(QObject):
 def __init__(self,iface,....)
  QObject.__init__(self)
  self.iface=iface
  ...
 def run(self):
  while 1:
  -search informations from DB
  -edit the layers
  -refresh the map
   time.sleep(5)

in the run function of the plugin:
self.thread=QThread()
self.test=worker(self.iface,....) #all the other parameters
self.test.moveToThread(self.thread)
self.thread.started.connect(self.test.run)
self.thread.start()

However, when I print something by the created thread, after exactly 16 to 18 iterations, the threads created don't stop working but my CPU at 100% and the main window of qgis freezes or does not work at all.

Can someone explain why this error is happening?


texts: Representing uneven tree canopy spread around point in QGIS

texts:
I am trying to make an attribute to show the uneven spread of the crown of a tree using the four cardinal points. I can use a buffer to show one feature, in this case a root protection area. But I need to be able to make an ellipse that bulges from a point, for example; 2 meters North, 2 meters East, 5m South, 4m West.
I was able to use this info different diameter circles for the buffer for the root protection area. I am very new to GIS. Hope the quick drawing helps.


texts: How to import multiple python scripts in one script tool

texts:
ESRI gives the option to import a script directly into a tool in your toolbox, eliminating the need for managing both the toolbox and the python script it refers to.

I have a script tool that refers to one script, but that script uses another script (stored in the same folder). I would like to import both scripts into the tool, so that I only have to manage the toolbox. ESRI only offers the option to import one script.

How can I import both (or multiple for someone else his/her case) scripts into one tool?


texts: need to find max value among fields AND PRINT FIELD NAME

texts:
I have a Census dataset that contains eight fields with percentages. I would like a python script that finds the highest value between the eight fields, but  also tells me which field the highest value came from. I've gotten halfway there using Field Calculator in ArcMap 10.3, using the max(!field1!, !field2!, !field3!) script.

However, I also need it to be able to somehow add the field name because ultimately, the field name is what I want in a new indivisual field, and I will symbolize based on that field.

So far, my programmer colleague helped me come up with the following python script  but I am getting an error message regarding my gp and not too python savvy to get it working.

import arcpy
fc = "C:/filename" #or shapefile address
gp = arcgisscripting.create()

# Create update cursor for feature class.
rows = gp.UpdateCursor(table)
row = rows.Next()

field_list = ["ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT"]

while row:

    highname_values = [row.GetValue(f) for f in field_list]
    zipped = zip(eth_values, field_list)
    zipped.sort(key=lambda t: t[0], reverse=True)
    row.highname = zipped[0][1] # replace ETH for the field that you want to update with the field name (ONE, TWO, ETC)
    row.HIGH = zipped[0][0]
    rows.UpdateRow(row)
    # Go to the next
    row = rows.Next()


texts: How to calculate distance between two 3D points in kilometers using postgis

texts:
I get latitude, longitude and altitude using android.location.Location, after that I send this data on the server, and save it using:

update users set location = ST_SetSRID(ST_MakePoint(-40, 40, 40), 4326) where id = 1;

users.location column was created using:

SELECT AddGeometryColumn ('users', 'location', 4326, 'POINT', 3);

I already saw an answers about 2D points, or answers in which you need to translate one SRID into another, and this is confused me. I want to know correct way from the Android to the postgis.

So, how can I calculate distance between user with id 1 and user with id 2 in  kilometers using postgis?

UPD:

SELECT AddGeometryColumn ('users', 'location', 4326, 'POINT', 2);

update users set location = ST_SetSRID(ST_MakePoint(-118.4079, 33.9434), 4326) where id = 1;

update users set location = ST_SetSRID(ST_MakePoint(2.5559, 49.0083), 4326) where id = 2;

SELECT ST_Distance(a.location, b.location)/1000 as Dist_deg from users a, users b where a.id=1 AND b.id=2;

Output:

 0.121898285970107

This is wrong(since these are degrees), so I tried this:

SELECT ST_Distance(ST_Transform(a.location, 2163), ST_Transform(b.location, 2163))/1000 as Dist_deg from users a, users b where a.id=1 AND b.id=2;

Output:

 8731.12032614592

So, this is wrong too.


texts: How to stop "Iterate Rasters" after a "n" number of iteration

texts:
I have a geodatabase with several hundred rasters. I would like to make an iteration and carry out zonal statistics for every raster in the geodatabase. The problem is, that I don't want to iterate all the rasters at once, I would like to be able to stop iteration after every 12 rasters.

I tried to use Calculate Value to Stop the model after every 12 rasters so if the numeration starts from 0, the first break would be at the raster called t11

But it seems that Calculate Value doesn't work for string values. How is it possible to stop iterating after every 12 rasters?


texts: Create multiple vector layers with one GeoJSON in OpenLayers

texts:
I am a beginner to OpenLayers,and what i'm trying to do is to create multiple vector layers with one GeoJSON in OpenLayers 3.
Here is a small part of the GeoJSON file.

{"type": "FeatureCollection",
   "features": [
  {
    "type": "Feature",
    "geometry": {
           "type": "Point",
           "coordinates":  [ 7.07,44.91 ]
        },
    "properties": {
        "Type":"Animals",
        "JS_Date":1470433175,
        }
  },
  {
    "type": "Feature",
    "geometry": {
       "type": "Point",
       "coordinates":  [ 5.97,44.78 ]
    },
    "properties": {
    "Type":"Contaminations",
    "JS_Date":1470433145,
    }
  },
……]
}

I read an old topic about that, but i didn't manage to adapt his solution to mine.

What I’m trying to do, is to create two different layers depending on the GeoJSON properties. therefor I want a layer with all features which have as properties type “Animals” and another layer with all features which have as properties type “Contaminations”.

Currently the code I have to display features in one layer is this one:

var GeoJsonDATA=new ol.layer.Vector({
    source: new ol.source.Vector({
        url: '../Data/Observations.geojson',
        format: new ol.format.GeoJSON()
            }),
    name: ‘UserData’,
});


texts: How does Carto make it possible to interact with elements on their tiles? Can I do the same with Leaflet?

texts:
I was looking at this Carto Map. You can click on a building and it shows some extra information about it.
Then I noticed that these buildings weren't added as individual polygons or something like that, but instead are part of generated tiles that has been added to the map. Here is a an example of a single tile.
If you look at the code these tiles have the leaflet-tile class, so it seems like Carto are using Leaflet for adding the tiles to the map.
But how is it possible that there is interaction? I don't think it's possible to interact with PNG files like this, so what is going on?
I have a large dataset of buildings. If I add them to a map using Leaflet the map gets really slow, so I would like to use something like Mapnik to generate the tiles and make things a lot faster. But as far as I know I will then lose interactivity, which is a real shame.
Is there a way to use Leaflet to add tiles rather than features and keep interactivity with the features that are generated onto the tiles?


texts: Calculating width along grid points using ArcGIS Desktop?

texts:
I have a shapefile of a glacier for which I need to determine the width along every point of the flow line (the brown dots).

I want to do this by determing the length of a perpendicular line through each of the brown grid points within the glacier's boundaries

How can I do this efficiently?

.


texts:
I'm downloading non-georeferenced .png image files from a WMS in a grid of 5x5. The corners of the boundingbox are known and now I want to automatically georeference these files. What is the fastest way to do this? Should I go for a world file (and how?) or should I just georeference every image on its own (and how?).

The tiles will be downloaded every day again and used for detecting the changed regions.


texts: Exporting All features in view extent using ArcGIS Pro?

texts:
Is there an easy way to export selected features, or features in the current map extent, to a File Geodatabase?

In ArcMap, I can export data from a single layer, and select All features in view extent, but this option does not seem to be available in Pro. The tools on the Share tab all seem to export entire featureclasses.

If possible, I would like to export data from multiple layers at once, and also include relationshipclasses between the features.


texts: QGIS 2.18 label by expression concatenate field strings

texts:
For a building layer I have an attribute table with several fields for the building type where data was entered with a manually created form using checkboxes. Example:

Production: 1 = (yes), 0 = (no)
Office: 1 = (yes), 0 = (no)
Storage: 1 = (yes), 0 = (no)

and so on...

Now I want to label this layer with first letter of the respective building type. Like e.g: Production = P, Office = O, Storage = S and so on...

In case its only only one type its easy. I create a new field and use an expression like this:

CASE WHEN "Production" = 1 THEN 'P' ELSE '' END

But many buildings refer to multiple types, so I'd like to have expression that wraps everything up. It should check the state of the check box fields and concatenate the respective letters in a new field:
Examples:

P/S

O/S

P/O

P/O/S

How to do so?


texts: Use non-georeferenced raster with reference grid in QGIS 2.14

texts:
I have on one side a set of images in raster, which are not having any spatial reference, and on the other side a grid with spatial references. Each image supposedly fit perfectly in a cell of the grid. I would like, without hazardous manual georeferencing, to use the grid in order to give the rasters spatial references according to the grid references.

Any idea on how I could achieve this ?


texts: ArcGIS Mouse Cursor Stuck in Auto Pan / Continuous Zoom mode

texts:
When using ArcGIS while in layout mode, after a variable period of time having an open ArcGIS project, the mouse cursor will get stuck in "Auto-Pan" mode. No matter which tool I select from the toolbar, the cursor stays the same. If I hit the "C" or "Ctrl" key repeatedly, the cursor will assume its proper form and function, but revert to auto-pan the next time I change the tool.

This has persisted from 10.0-10.3 and multiple machines. The only way to fix it is to restart the machine. I get a brief respite, and the problem is back.

Does anyone have a solution to this problem?


texts: Add a border and change border color of a marker in OpenLayers

texts:
I want to add a border color to the icons in OpenLayers. I also, want to be able to change the color of this border depending on the attribute of the marker. Is there any easy way to do this?
The code below allows you to click the icon and make a border color appear. However, I want the color to be their from the beginning and not depend on the clicks. Also, I want it to change depending on the variable. If anyone has any idea please let me know.

class MapComponent implements OnInit {

  map:Map;
  iconVectorSource: VectorSource;
  iconVectorLayer: VectorLayer;

  iconArr: Feature[] = [];

  constructor() { }

  ngOnInit() {

  this.map = new Map({
    target: 'map',
    view: new View({
      projection: 'EPSG:4326',
      center: [114.190750, 22.339914],
      zoom: 12,
      minZoom: 12,
    }),

    layers:[
      new TileLayer({
        source: new OSM()
      }),
    ]
  });
  this.addIcons();
  this.addSelect();

  }
  public addIcons(){
    let icon1 = new Feature({
      geometry: new Point([114.190750, 22.339914]),
      imgSrc: 'assets/purple.png',
    });

    icon1.set('style',this.createStyle(icon1.get('imgSrc'), undefined));

    this.iconArr.push(icon1);
    this.iconVectorSource = new VectorSource({
      features: this.iconArr,
      wrapX: false,
    });
    //creates a layer and use the source in the layer
    this.iconVectorLayer = new VectorLayer({
      source: this.iconVectorSource,
      style: function(feature){
        return feature.get('style');
      },
    });
    this.map.addLayer(this.iconVectorLayer);

  }

  public addSelect(){
    var select = new Select({
      style: function(feature) {
        var image = feature.get('style').getImage().getImage();

          var canvas = document.createElement('canvas');
          var ctx = canvas.getContext('2d');
          var activeColor = "red"; //set border color
          var dArr = [-1,-1, 0,-1, 1,-1, -1,0, 1,0, -1,1, 0,1, 1,1], // offset array
              s = 2,  // thickness scale
              i = 0,  // iterator
              x = 2,  // final x position
              y = 2;  // final y position

          //set new canvas dimentions adjusted for border
          canvas.width = image.width + s + s;
          canvas.height = image.height + s + s;

          // draw images at offsets from the array scaled by s
          for(; i < dArr.length; i += 2)
          ctx.drawImage(image, x + dArr[i]*s, y + dArr[i+1]*s);

          // fill with color
          ctx.globalCompositeOperation = "source-in";
          ctx.fillStyle = activeColor;
          ctx.fillRect(0,0,canvas.width, canvas.height);

          // draw original image in normal mode
          ctx.globalCompositeOperation = "source-over";
          ctx.drawImage(image, x, y,image.width, image.height);

          //create new openlayers icon style from canvas
          return new Style({
              image: new Icon(/** @type {olx.style.IconOptions} */ ({
              crossOrigin: 'anonymous',
              src: undefined,
              img: canvas,
              imgSize: canvas ? [canvas.width, canvas.height] : undefined
            }))
          });

      }
    });
    this.map.addInteraction(select);
  }

  public createStyle(src, img) {
    return new Style({
      image: new Icon(/** @type {olx.style.IconOptions} */ ({
        crossOrigin: 'anonymous',
        src: src,
        img: img,
        imgSize: img ? [img.width, img.height] : undefined
      }))
    });
  }

}


texts:
I am trying to export my map layout in QGIS3.4.5 on OSX 10.14.

I've made the layout look exactly how I want it to look, but whenever I export to PDF, the PDF file is just a blank white page. The console gives me the message: "Export layout: Successfully exported layout", which is puzzling. When I export to TIFF and PNG, it gives me the same message, but no file is output.

The map I'm trying to make is really basic. I attached a screenshot here, in case there is something I am missing. It's just a hillshaded DEM and some symbolized X-Y data. I would think this would be an easy thing to fix, but all the solutions to similar problems I've seen on here have not worked.

Solutions I have tried:

Reduce the file size of the rasters by clipping them to my study area
Lower the DPI
Export to image
Remove ESRI basemaps from QuickMapServices.


texts: Set default raster output format in qgis

texts: When I save a map as image, either from the main window or from a print composer in qgis  (v 2.0.1) on debian, the default format is BW-files. Never heard about them before, never used them.. Is there any way to set another (i.e. .png) as the default image format? I have not been able to find anything in Settings / Options. Is it possible to set it directly in some configuration file? (I am using qgis both on linux and windows on the latter, the file format "sticks")


texts: r.sun from QGIS toolbox doesn't give realistic value about the hours of insolation

texts:
I have a problem with the GRASS module r.sun when I run it in QGIS.
I would calculate the hours of insolation in a specific site during a specific day. When I ran the algorithm "r.sun" from GRASS, it works very well, but when I launch the same algorithm from QGIS toolbox the result is different and not so realistic.  Do you know if any specific setting is needed in order to run correctly the algorithm also in QGIS? Is it a problem of region definition?


texts: Reproject, then clip or clip, then reproject?

texts:
I have a fairly simple question. I have a global categorical land cover map that has no projected coordinate system (i.e. it uses the EPSG:4326 coordinate reference system with no projection). My study region encompasses an international regional geographical scope (for e.g. South Asia). I have to apply a projection to the data because I need the units of measurement to be in metres and not degrees.

My question is this; do I

apply a projection to the global map, then clip it to my region of interest (using a similarly re-projected vector country boundary layer)...or do I
clip it to my region of interest using an un-projected vector country boundary layer (i.e. EPSG:4326) and then reproject the resultant clipped raster to a suitable projection?

I am unsure which method is the proper method, can someone enlighten me? Or maybe they make no difference at all. But just thinking about it, it sounds like the first option is more sound (robust) as opposed to the second, primarily because my input data is a global dataset. Additionally, one reason I am thinking so is because I find it difficult to get appropriate projection systems that cover a regional landscape, but it is relatively easier to find multiple global projections.


texts: Optimizing identification of tree stand boundaries

texts:
I am working on a workflow to identify tree stand boundaries. My desired result is the blue lines - I know it will never be like that, but I need it to be as good as possible. My best result is the red lines. The final result must not be polygons, but lines.

So this is what I have done so far:
I am using a Normalized DSM with pixel-size 2x2 as my starting layer.
This is my workflow:

I use i.segment where my best results have been with Difference Threshold=0.4 and Minimum Number of cells = 150.
Then I use r.to.vect because Polygonize for some reason didn't work in this workflow (?).
After this I convert to lines, and delete duplicates.
I use line simplification with Tolerence 8.5 (best result)
And last I use v.generalize with Maximal Tolerance Value=21 with the Douglas algorithm.
So I use four variables to make my result better. I have tried to use some more of the other variables, but honestly I am not sure how they affect the result.
So I am asking here for any suggestions to make my result better?
Update:
I managed to make it slightly better by keep changing the variables above.
I tried some other variables:

In segmentation I changed the amount of memory to use in MB, but it had no effect.
In v.generalize i tried all different algorithms, and Douglas appears to be the best.
I also tried changing the Look-ahead parameter in v.generalize, but it had no positive effect.

So I am still hoping for any "out-of-the-box" suggestions to make it better.
Update-2:
I am still working on this.
I have tried different variations for rastarinputs.
I have tried the following:

Normalized DSM (resolution 2x2)
Normalized DSM (2x2) + orthofoto
Normalized DSM (2x2) + orthofoto + Orthofoto CIR
Orthofoto + Orthofoto CIR
Normalized DSM (2x2) + DSM (2x2)

I have also tried different resolutions, but 2x2 gives the best result.
I have also learned that combining three rastar inputs gives a worse result.
My best results is either just using Normalized DSM (2x2) or the combined input with Normalized DSM (2x2) + DSM (2x2).
Still hoping for some suggestions. I am open for trying an other open source product.


texts: GeoDjango application using SpatiaLite database

texts:
I want to create a simple GeoDjango app with SpatiaLite database but I have this error at migrate:

  django.core.exceptions.ImproperlyConfigured: Unable to load the
  SpatiaLite library extensio`.

Here the code :

settings.py

INSTALLED_APPS = [
    ..................
    'django.contrib.gis',
     .............
]

DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.spatialite',
        'NAME': os.path.join(BASE_DIR, 'basetest.sqlite3'),
    }
}

Where I went wrong?


texts: In OpenLayers how can I enable a user to change a point into a line

texts:
Using ol3 I can use ol.interaction.Modify to enable users to move points, and add, move and delete vertices of lines and polygons.

Is it possible to enable users to change a point into a line (or a polygon)? One use case is where they have identified houses with points at a low zoom level, but now want to go to a higher zoom level so want to show the same houses as polygons.

I can think of one way (by providing a special button), but is there any more natural OpenLayers way?


texts: QGIS: Placing points relative to a specific coordinate

texts: I have some delimited-text point data that is encoded as X,Y positions relative to a given coordinate. So, for example, 1 5 represents a point 1 meter east, five meters north of the origin coordinate. It is essentially a UTM projection but does not use a standard zone. What is the best way to import this data into QGIS?


texts: Google Maps API v3 vs v2 (JavaScript): overlay problems

texts:
I have been using the Gmap API (v2) for dynamically displaying some data:

oMap.map = new GMap2(document.getElementById("map"));
oMap.geoXml = new GGeoXml('http://darudar.org/var/files/workaroud/gmap/data.php?num=30');

I changed to v3 of the API, using the following code:

var georssLayer = new google.maps.KmlLayer('http://darudar.org/var/files/workaroud/gmap/data.php?num=30');
georssLayer.setMap(oMap.map);

Unfortunately, after the change the data markers do not show correctly or do not show at all. With v2, zooming and scaling allows a kml layer to get a BBOX array and to redraw the markers correctly. Does anyone know how to recreate this functionality with v3 of the API ?

PS: Sorry for my eng...


texts:
I've set up a PostGIS database and imported my map data. Then I ran

render_list

to render my tiles. Serving them through mod-tile works just fine. However, the files on my HDD are *.meta files and I would like to obtain *.png files in the standard z/x/y OSM format. How can I prerender my files?

From what I've seen, there's a python script called 'generate_tiles.py' in this repository: https://github.com/openstreetmap/mapnik-stylesheets/blob/master/generate_tiles.py

I'm not entirely sure how to use it though. I also don't fully understand the difference between XML and CartoCSS and how it applies to my use case.


texts:
Here is a contour map for which all the polygons of levels are available.

Let ask how to smooth the polygons keeping all vertices preserved in their exact locations?

Indeed the contour is made on top of a grid data, you may suggest then to smooth the grid data and hence the resulting contour will be smoother. Note that this is not working as my desire since the smoothing function such as Gaussian filter will remove small packs of data and will change the range of the third variable e.g., the height which are not allowed in my application.

Actually I'm looking for a piece of code (preferably in Python) which can do the smoothing of 2D polygons (any type: convex, concave, self-intersecting etc) reasonably painless (forget pages of codes) and accurate.

FYI, there is a function in ArcGIS that does this perfectly, but using third party commercial applications is not my choice for this question.

1)

Scipy.interpolate:

As you see the resulting splines (red) are not satisfactory!

2)

Here is the result using the code given in here. It is not working well!

3)

To me the best solution should be something like the following figure in which a square is being smoothed gradually by changing only one value. I hope for similar concept for smoothing any form of polygons.

Satisfying the condition that spline passes the points:

4)

Here is my implementation of "whuber's idea" line by line in Python on his data. There are possibly some bugs since the results are not good.

K=2 is a disaster and so for k>=4.

5)

I removed one point in the problematic location and the resulting spline is now identical to whuber's. But it is still a question that why the method does not work for all cases?

6)

A good smoothing for whuber's data can be as follows (drawn by vector graphics software) in which an extra point has been smoothly added (compare with update

4):

7)

See the result from Python version of whuber's code for some iconic shapes:

Note that the method seems doesn't work for polylines. For the corner polyline (contour) green is what I want but got red. This needs to be addressed since contour maps are always polylines although closed polylines can be treated as polygons as in my examples. Also not that the problem emerged in update 4 has not been addressed yet.

8) [my last]

Here is the final solution (not perfect!):

Remember that you will have to do something about the area pointed by stars.  There is perhaps a bug in my code or the proposed method needs further development to consider all situations and to provide desired outputs.


texts:
We have a dataset with a personal GDB (mdb) with several feature classes and an mxd tied to those features to create layers based on definition queries…

Currently to QAQC our data we use MsAccess queries to cross check data both within a feature class table and across feature classes that have common ID’s…

This is building space data, so things we check are a field that marks the space vacant [sp_vacant ] and another field within the same feature class that marks the space classification (hallway, stair, office, etc [sp_type])… Since we do not want to mark public areas as vacant the query checks any vacant values against the space type to get a list of possible errors…

Another type of MSAccess query we run would be to check personnel recorded for that building [sp_person] in one feature class against a matching field [sp_type] from the other feature class where both features contain matching room ID’s [sp_ID]…

To do the previous we build queries in Access, export those tables in Excel and use them as a checklist to edit possible mistakes. I then have to go back in Access once edits are made to re run the queries to check for completeness.

Rather than all that I would like to create, run and view the same type of queries in ArcMap rather than using MsAccess.

Or perhaps getting an editable layer with attributes that I can change directly and those changes will propagate to the original feature class data.

So a table or preferably layer that responds to a sql like query.


texts: Mac QGIS files to Windows Arc GIS compatibility

texts: If I download QGIS on to Mac will the shapefiles and layers I create be compatible with ESRI ArcGIS 10.1 on windows?


texts:
I want to turn on/off some layers according to zoom level, my code are like this

    map = new OpenLayers.Map( 'map', options,
            {div: "map",
             allOverlays: true
             });
      var vaga_wms = new OpenLayers.Layer.WMS( "Road",
                "http://localhost:8090/geoserver/wms/wsNYCRoad", {
                layers: 'vagar_alla_p',
                styles: '',
                transparent:true,
                tiled: 'false'
            },
            {
                buffer: 0,
                displayOutsideMaxExtent: true,
                isBaseLayer: false
            });

       var jvg_wms = new OpenLayers.Layer.WMS( "Railway",
                "http://localhost:8090/geoserver/wms/wsNYCRoad", {
                layers: 'jvg_p',
                styles: '',
                transparent:true,
                tiled: 'false',
            },
            {
                buffer: 0,
                displayOutsideMaxExtent: true,
                isBaseLayer: false
            });

       var building1_wms = new OpenLayers.Layer.WMS( "Building",
                "http://localhost:8090/geoserver/wms/wsNYCRoad", {
                layers: 'bygg_lant_p,bygg_off_p,bygg_ovr_p',
                styles: '',
                transparent:true,
                tiled: 'false'
            },
            {
                buffer: 0,
                displayOutsideMaxExtent: true,
                isBaseLayer: false
            });
map.addLayers([gmap,ghyb,gsat,gphy,jvg_wms,vaga_wms,building1_wms,vectors]);
    .
    .
    .
    map.events.register('zoomend', this, function (event) {
                    var zLevel = map.getZoom();
                    if( zLevel == 1 || zLevel == 2 || zLevel == 3)
                    {
                        jvg_wms.setVisibility(false);
                        vaga_wms.setVisibility(false);
                        building1_wms.setVisibility(false);

                    }
                     if( zLevel == 4 || zLevel == 5 || zLevel == 6)
                    {
                        jvg_wms.setVisibility(ture);
                        vaga_wms.setVisibility(ture);
                        building1_wms.setVisibility(ture);
                         map.addLayers([gmap,ghyb,gsat,gphy,jvg_wms,vaga_wms,building1_wms,vectors]);
                    }
                    });

These 3 layers indeed turned off when zoom levels are smaller than 4, however, they couldn't turn on when zoomed in .

Where did I do wrong?


texts: Improving PyQGIS distance matrix efficiency

texts:
I have written a custom processing tool, which I use within a large graphical model in QGIS. I am looking for a way to speed it up.
First step of this processing tool is to connect every point of one input layer to every point of another input layer and measure its line length. This takes quite a while, because usually both layers have more than 10000 points. But I am only interested in point pairs within a given distance to each other. So currently I am going to delete the lines afterwards, which are too long. I think this is quite ineffective, and therefore wanted to ask if there is an easy way to speed up this step, by using a spatial index or something like that. I could create one by using index = QgsSpatialIndex(layer.getFeatures()), but how would I proceed to only connect points I am interested in?
This is a minimal part of my current code:
Memorylayer_VL = QgsVectorLayer(str('LineString?crs=25832')), "tmp_lines", "memory")
Memorylayer_PR = Memorylayer_VL.dataProvider()
maxdistance = 150

# iterate over stop features and create lines
for stop_feat in stop_layer.getFeatures():
    point1 = QgsPoint(stop_feat.geometry().asPoint())
    for source_feat in possibility_layer.getFeatures():
        point2 = QgsPoint(source_feat.geometry().asPoint())
        temp_feat = QgsFeature(fields)
        temp_feat.setGeometry(QgsGeometry.fromPolyline([point1, point2]))
        temp_feat["line_length"] = temp_feat.geometry().length()
        # Only add lines shorter than maxdistance and longer than 1m (Already simplified like this thanks to @BERAs suggestion in comments)
        # However, couldn't using a spatial index even have more effect?
        if (temp_feat.geometry().length() < maxdistance) and (tmp_line_feat.geometry().length() > 1):
            Memorylayer_PR.addFeature(temp_feat)
            Memorylayer_VL.updateFields()
Memorylayer_VL.commitChanges()

# Doing more processing stuff on the just created lines layer....


texts:
I'm trying to run a viewshed analysis of building. My original building layer was a vector which had a height attribute. I converted this to raster and added my elevation layer to my building raster layer. I used the output raster "DEMBuilding" as the input for my viewshed analysis but keep getting a NODATA error for the 'DEMBuilding' layer?

Any suggestions?


texts: Only output points near borders, excluding points near coast

texts:
I would have liked to ask for help, being confronted to a problem with ArcGis. I have in fact a shapefile of countries and a bunch of points. I would have liked to keep only the points that are located near the border with another country. In other words, I would have liked to exclude the points on the coasts (seaward)

Do you have any idea ? Before I used the Select by Location tool to keep only the points within a certain distance of the source shapefile.


texts: How to create a worldfile by bounding box?

texts:
I need to create a worldfile from Bigmap Application. I've successfully to grab a pack of PNG tiles and the pearl app mosaicking all in one. The BigMap site shows the raster bounding box and util metadata:

Map is 12x12 tiles (3072x3072 px) at zoom 18, aspect 1:1
-43.475647,-22.886297,-43.459167,-22.871114 (l,b,r,t)

This is my local png map | http://goo.gl/oY8vA

This is my pgw configuration:

3072----------X?
0
0
-3072---------Y?
-43.475647----left?
-22.871114----top?

How I create a PGW file  in Quantum GIS or another app?

Jorge Santos


texts: What are the appropriate input/output ranges for WorldView 2 in GRASS i.atcorr module?

texts:
Can anyone speak to the appropriate range/datatype of WorldView2 rasters when using the i.atcorr module in GRASS GIS?

I.atcorr requires the input raster be in at-sensor-radiance first, which I have done according to DigitalGlobe documention. DG suggests all transformations be done in FLOAT32 datatype; however, i.atcorr requires a specified input/output range that is positive.

Now, I could convert from DN's (UINT16) to radiance (FLOAT32) and then re-scale to positive values (?), but I am not sure if this would leave me with the WorldView2 range that i.atcorr is seeking... For example, Sentinel 2 L1C are also encoded as UINT16 with 15 significant bits. However, documentation states that the correct i.atcorr Sentinel range is 1-10000; 10000 being a specified QUANTIFICATION_VALUE by Sentinel.

Is there a WorldView 2 equivalent to this quantification value? Even when using the new images converted to radiance? Is there an alternative range specific to WV2? And either way, what would the appropriate output/rescale value be for using i.atcorr with WV2?

Any insight would be greatly appreciated!

*WV2 is encoded in UINT16 with an 11-bit dynamic range


texts:
I'm trying to export my colored raster map. Colors are very important for me. But I couldn't export it according to my colors. When I tried different methods it gives an error:

  output file format with specified pixel type or number of bands or colormap is not supported

or whole map is black. I mean even out of study area boundaries.

Any solution to this?

I am using ArcGIS 10.3.1 for Desktop.


texts:
I have been trying for a couple of days to perform three very simple tasks combining GeoServer, OpenCycleMap base map and OpenLayers 3. I am following the pg_routing workshop as I am using a function that let the user click on the map and retrieve the shortest path with an ol.overlay command. I can plot an OpenCycleMap with my data in a different web page but when I try to add the layer in the model of the pg_routing workshop I get the error 'undefined is not a function' immediately after the declaration of the new WMS layer source: new ol.source.ImageWMS().

I paste the entire web page code here, I have searched extensively everywhere, adding a layer is a very simple operation and I can make in another web pages without the click function. I think it is related to this if I can't easily add a new layer but I can't find where the problem is, can someone help me?

<!DOCTYPE html>

    <title>ol3 pgRouting client</title>
    <meta charset="utf-8">
    <link href="ol3/ol.css" rel="stylesheet">

start

final

      <button id="clear">clear</button>


texts: How to make path similar in the leaflet and in database for the tiles of a basemap

texts:
The Tiles in a database files has values for a tile like at zoom level 13 column 5869 and row 3370. However the leaflet and python generates the tile number as column 4782 and row 1162 at zoom level 13. The coordinates for both cases(tiles generated and in leaflet) are same as 77.970736, 30.146494 and zoom level 13.

var map = L.map('map').setView([77.970736, 30.146494],13);
    // var map = L.map('map').setView([0, 0],13);

     //  L.tileLayer('four.gpkg/{z}/{x}/{y}.png', {
    L.tileLayer('four.gpkg?table=tiles&z={z}&x={x}&y={y}', {
        maxZoom: 15,
   }).addTo(map);

Results from leaflet Web Console for a tile

But from database

Zoom level  | tile_column | tile_row |tile_data

13          |   5869      |   3370   | BLOB

Attempts:

Tried to change the values in the leaflet.
Tried to redownload the tiles, from different sources.

All attempts have given no proper results.

The database is GeoPackage that has structure as above.

Projection:Tiles were generated using Mobile Atlas Creator(MOBAC), so its WGS84,as it shows in the MOBAC.

Tiles were converted using GDAL as well as from cloud service. But the problem remains same.


texts: How do I correctly remove the buffer using catalog_apply?

texts:
I'm applying lasnormalize with catalog_apply in lidR with opt_chunk_buffer set to 20 metres. I do not remove the buffer explicitly and the normalized las files, which are returned, include the hits from the buffer (i.e. my resulting las files now extend 20 metres beyond their original extent). I had interpreted the lidR manual that buffer removal is automatic - but maybe I need to remove the buffer with code? Many thanks for clarifying.

library(lidR)
ctg <- readLAScatalog("J:/2019/LAS")

normF = function(chunk)
{
  las = readLAS(chunk)
  if (is.empty(las)) return(NULL)

  # skip las files that do not have ground hits
  ground <- lasfilter(las, Classification == 2)
  if (is.empty(ground))
    return(NULL)

  lasNorm <- lasnormalize(las, algorithm = knnidw(k = 10, p = 2), na.rm = FALSE, use_class = c(2L, 9L))

  #-----------------------------------------------------------------
  # This is the line needed, as identified in the answer below...
  lasNorm <- lasfilter (lasNorm, buffer == 0)
  #-----------------------------------------------------------------

  return(lasNorm)
}

opt_filter(ctg) <- "-drop_withheld -drop_overlap -drop_z_below 0"
opt_chunk_buffer(ctg) <- 20
opt_output_files(ctg) <- ("J:/2019/LAS_normalized/{ORIGINALFILENAME}_norm")
mylasCatalogueNorm <- catalog_apply(ctg, normF)


texts:
I am trying to convert a raster data to polygon data. Previously I was using the shapefile.py to create point data on individual lat/lon on the raster. But that will create a Huge data and querying it will be a Big issue.

So, it would be better if I am able to convert the raster data into a polygon data. I was able to find SAGA, but it seems that it can only convert the .grd files. Is there a way to convert GeoTIFF format or raster datasets in general to Polygon?

UPDATE: Using gdal_polygonize.py

I am executing the following line of code,

gdal_polygonize.py ~/development/Biodiversity/biodiversity/GeoTIFF/bio11.tif -f "ESRI Shapefile" bio11.shp

But I am getting the following error. My gdal version is 1.9.0.

Traceback (most recent call last):
  File "/usr/bin/gdal_polygonize.py", line 34, in <module>
    import gdal, ogr, osr
  File "/usr/lib/python2.7/dist-packages/gdal.py", line 2, in <module>
    from osgeo.gdal import deprecation_warn
  File "/usr/lib/python2.7/dist-packages/osgeo/__init__.py", line 21, in <module>
    _gdal = swig_import_helper()
  File "/usr/lib/python2.7/dist-packages/osgeo/__init__.py", line 17, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: libjvm.so: cannot open shared object file: No such file or directory


texts: I have added a online tile source in the 'XYZ Tiles' option, and added it as a layer, which works fine. But im trying to understand where the extents shown in the layer properties is coming from? When I just loaded a simple JPEG as a raster background, my coord system and extents was just the pixels of the background, and origin 0,0 in a corner. But now with the tile source the origin is the middle (which is not a big deal) but the extents are like (big, see image) it would seem totally disconnected from the actual image widths, which is throwing out my coord system.


texts: Using python to publish feature services to arcgis online WITHOUT Arcgis Server

texts: My small non-profit currently uploads feature services manually by zipping shapefiles and "overwriting" them. I'm trying to automate this process in python and have only come across ago tools and  ArcREST.  ArcREST seems to be the more robust module but its usability seems predicated on access to an Arcgis Server  and we don't have that capacity atm. I see that there might be a way to create  .sd files and upload them using a python script but I am confused on how to do this. Can anyone point me in the right direction with a sample script and/or some instructions on how to do this? I have arcmap 10.2


texts: I am very new at GIS. I am trying to load a raster so that I can complete a tutorial on georeferencing. The raster file is a jpeg. However, whenever I try to load the raster, it gives me solid colored lines that are completely distorted from the original. I realize this is probably a very simple fix. Example:


texts:
How can I change the fill border color for vector layers? I want to make it Transparent Fill. I have 1000 shapefiles, and want them to be transparent fill.
Is there a way to do it by Python Script?


texts: Creating attribute tables and joining tables

texts: I hope someone can help me! So I have multiple shapefiles and layers. I didn't give them an ID when I created them. But now that I have finished my drawings, I need to give them an id (?) and I need to join an excel table where I have all the information for each layer (more than hundred), so people can look for different attributes. So I have to give an id one by one? And what step should I do next so I can join tables? I've been looking for it but all the examples only have one layer, and I need to know how to do that for multiple layers.


texts: Iterating features and buffering using GeoPandas?

texts:
I have a shapefile with many large polygons and would like to process each polygon individually because spatial operations on the entire dataset are too big for memory. For instance, iterate shapefile, buffer each polygon, calculate zonal statistics, and store results as a single geodataframe.

Can we iterate through the geopandas dataframe to buffer each polygon separately?

My initial code doesn't appear to update the geodataframe's area after buffering.

import geopandas as gpd
#import rasterio

fp = r"E:\Polygon_Features.shp"
data = gpd.read_file(fp)
print(data.area)

data_buffer = data.copy()

for index, row in data_buffer.iterrows():
    row['geometry'] = row['geometry'].buffer(500)

print(data_buffer.area)


texts:
Is it possible to disable the mobile canvas in CartoDB when using the embedded maps?

When I add extra text to a legend and define the the width of it, the legend isn't displayed correctly on the mobile device but looks perfect in desktop mode.

If I don't fix the width the legend takes up way too much space.

this is my vis


texts: why the graphics layer coming from the Geoprocessing service in WGS_84, is projected correctly on a Web Mercator Auxiliary Sphere Basemap

texts:
I have made a  Geoprocessing service, which results (features) are in wgs_84 (4326).
My map's spatial reference is wgs_84 Web Mercator Auxiliary Sphere 102100 (projected system)
Considering that the graphics layer is not re projected on the fly, Why are the graphics placed in the correct position ? As I can see with firebug my graphics keep having decimal coordinates of WGS_84. While some feature layers I have, which are still in 4326 are reprojected on the fly and their X, Y coordinates are converted in meters


texts: Limiting imagery displayed to non-rectangular area using ArcGIS Desktop?

texts:
I have a layer that shows some imagery in Ontario. I would like to get rid of the imagery that I don't need, because I only need it to be in 6 "squares" that I have.

Is there a way to restrict the imagery to this area?


texts: I am trying to write a script (any) that will go to ArcCatalog and then to a database and then to ArcFM XML Export to export the dataset in XML.


texts: QGIS map creation: google imagery as base-map displaced when printed to pdf of tiff

texts:
I want to create a set of maps using the QGIS atlas feature.
It works quite well, however when printing the maps to an image or pdf, the base map (google maps areal imagery) is shifted under the rest of the map.

The screenshots show (a) the correct representation in the print composer and (b) the defective map I get when printing to .tiff. Is there any workaround on this issue?

(a) correct map in print composer

(b) defective map printed to .tiff


texts: Create an ESRI Shapefile from WKT with OGR

texts:
I want to create an ESRI Shapefile layer from a CSV file. In my CSV I have several attributes (text, numeric) and geometry in WKT style. I have a problem with the geometry field wich is truncated to a string field (254 characters), because I don't know how to declare it.

How to create ESRI Shapefile geometric data from WKT with ogr ?
ogr.CreateGeometryFromWkt() isn't the good way ?

Maybe with string formatting operators ?

CSV source file:

serialnumber;name;objectnumber;city;geom
034002002;Peter;1;34086;POLYGON ((676923.736 6265215.412,676954.294 ... ))
034002003;John;2;34284;POLYGON ((678870.753 6264475.605,678867.203 ... ))
034002004;Steeve;3;34086;POLYGON ((678001.823 6264195.123,677975.609 ... ))

I found this method wich explain how to parse a delimited CSV file to create an ESRI Shapefile. I'm using Python 3.7.4 and GDAL 2.3.3.

Python script:

# -*- coding: utf-8 -*-
import osgeo.ogr as ogr
import osgeo.osr as osr
import csv
import os
os.environ['GDAL_DATA'] = os.environ['CONDA_PREFIX'] + r'\Library\share\gdal'
os.environ['PROJ_LIB'] = os.environ['CONDA_PREFIX'] + r'\Library\share'

myInput = 'input.csv'

with open(myInput, 'r', encoding='utf-8') as csv_file:
    reader = csv.DictReader(csv_file, delimiter=';', quotechar='"')

    # set up the shapefile driver
    driver = ogr.GetDriverByName("ESRI Shapefile")

    # create the data source
    data_source = driver.CreateDataSource("output.shp")

    # create the spatial reference
    srs = osr.SpatialReference()
    srs.ImportFromEPSG(2154)

    # create the layer
    layer = data_source.CreateLayer("output", srs, ogr.wkbPolygon)

    # Add the fields we're interested in
    field_serialnumber = ogr.FieldDefn("serialnumber", ogr.OFTString)
    field_serialnumber.SetWidth(9)
    layer.CreateField(field_serialnumber)
    field_name = ogr.FieldDefn("name", ogr.OFTString)
    field_name.SetWidth(50)
    layer.CreateField(field_name)
    layer.CreateField(ogr.FieldDefn("objectnumber", ogr.OFTInteger))
    field_city = ogr.FieldDefn("city", ogr.OFTString)
    field_city.SetWidth(5)
    layer.CreateField(field_city)
    layer.CreateField(ogr.FieldDefn("geom"))

    # Process the text file and add the attributes and features to the shapefile
    for row in reader:
        # create the feature
        feature = ogr.Feature(layer.GetLayerDefn())
        # Set the attributes using the values from the delimited text file
        feature.SetField("serialnumber", row['serialnumber'])
        feature.SetField("name", row['name'])
        feature.SetField("objectnumber", row['objectnumber'])
        feature.SetField("city", row['city'])
        feature.SetField("geom", row['geom'])

        # create the WKB for the feature using Python string formatting
        wkt = (row['geom'])
        polygon = ogr.CreateGeometryFromWkt(wkt)

        # Set the feature geometry using the point
        feature.SetGeometry(polygon)

        # Create the feature in the layer (shapefile)
        layer.CreateFeature(feature)

        # Dereference the feature
        feature = None

        # Save and close the data source
        data_source = None

PS: QGIS is able to translate my CSV file to a layer when I import it as delimited source layer, so i'm sure this data is valid.


texts:
I am trying to create a basic form using ArcObjects (VB.NET) to view in ArcMap 10.0. I have created the form using the designer but can't view it in ArcMap. I have created a button that will call the form and show it using form.show() method but seems it does nothing when I click it.

How can I show GUI forms in ArcMap? I thought by creating a separate button to call the form will work?

Form code:

Public Class ArcGISForm

    Public Sub New(ByVal hook As Object)
        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        Me.Hook = hook
    End Sub

    Private m_hook As Object

    Public Property Hook() As Object
    Get
      Return m_hook
    End Get
    Set(ByVal value As Object)
      m_hook = value
    End Set
    End Property

    ''' <summary>

    '''creating and disposing the user interface class for the dockable window.
    ''' </summary>
    Public Class AddinImpl
        Inherits ESRI.ArcGIS.Desktop.AddIns.DockableWindow

        Private m_windowUI As ArcGISForm

        Protected Overrides Function OnCreateChild() As System.IntPtr
          m_windowUI = New ArcGISForm(Me.Hook)
          Return m_windowUI.Handle
        End Function

        Protected Overrides Sub Dispose(ByVal Param As Boolean)
          If m_windowUI IsNot Nothing Then
            m_windowUI.Dispose(Param)
          End If

          MyBase.Dispose(Param)
        End Sub

    End Class

    Private Sub ArcGISForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim frm2 As New ArcMapAddin2.ArcGISForm(Me.Hook)
        frm2.Hide()
    End Sub

End Class

Here is how I am trying to call the form, from a button.

Public Class showform
Inherits ESRI.ArcGIS.Desktop.AddIns.Button

    Public Sub New()

    End Sub

    Protected Overrides Sub OnClick()
        Dim frm As New ArcMapAddin2.ArcGISForm(Me.Hook)
        frm.Show()
    End Sub

    Protected Overrides Sub OnUpdate()

    End Sub
End Class

Any ideas how I can open the form from the button? Or should I follow a different method?

UPDATE:

I have tried the following and still doesn't work:

Dim oForm As ArcGISForm
oForm = New ArcGISForm(Me.Hook)
oForm.ShowDialog()
oForm = Nothing

All it does is close ArcMap down. When I click the button.


texts: Combining GeoServer vector tiles with QGIS

texts:
I am using QGIS 3.8 (or 3.4) with the vector tile plugin:
https://github.com/geometalab/Vector-Tiles-Reader-QGIS-Plugin
I've also installed the vector tiles plugin for GeoServer 2.15.1.

The problem that I am facing is how to integrate these 2 plugins. The tutorial on GeoServer handles how to integrate OpenLayers with Vector tiles.

But the QGIS plugin requests a:

TileJSON url
and/or a GL Style JSON url

I cannot find in the GeoServer documentation anything about what these URL's might be.

I've tried a couple of urls based on what I see Openlayers is doing, but no progress.

Does anyone have an idea of how to make this work?

EDIT: added extra picture for Dror:

EDIT 2:
I did more investigating, I think the QGIS plugin needs a capabilities document specifically looking like:


texts: Convert a polygon grid into an edge table

texts:
I'm working on a robotics project.  I've got a rectangular grid (polygon shapefile) that is a navigable/routable region (i.e. I can travel anywhere in this grid).  That is I took my bounding area subtracted the obstacle areas, then turned that into a grid of polygons.

I'm looking to do path planning with pgRouting, I need to convert this polygon file into an edge network.  I'm on the path of computing point centroids, connecting point to its 6 nearest neighbors into a line segment table (edge network) is there an existing tool?


texts:
due to unknown reasons my node tool stopped working appropriately. More precisely, I can select nodes just by selection window, not each node individually. Also, I can't move the nodes.

I attached a print screen with the snapping settings, in case the problem might be there.


texts: dbvalue functions don't seem to be working on QGIS3

texts:
I've brought a project with some virtual columns into QGIS3, but the formula with dbvalue functions (from the refFunctions plugin) in doesn't seem to be working any more. It just gives NULL values. The relevant layer is loaded and nothing else has changed since bringing the project forward (it still works in QGIS2.16).

When I looked this up on the web yesterday, I remember reading something about the fact that QGIS3 has changed a load of APIs (whatever they are) and so the formula won't work.

Does anyone know a way around this? Is it that I can't even reference other layers in QGIS3 (which seems like something of a retrograde step), or is there just a new way of doing it?


texts: Displaying concatenated attributes in a pop-up in a Mapbox map

texts:
I have been tasked with finishing off an abandoned project in an area I have no expertise in.

I need to add a series of GeoJSON files to a map, and when the symbol is clicked, show a pop-up that displays a title, location and image, all of which are fields in the attribute table.

Initially I just tried calculating a new field in the attribute table, with concatenated attributes formatted in html, and then using this field to label with in my pop-up.

concat('
', "pop-up title", '

', '
Attribute1_label:  ',
"attribute1", '

Attribute2_label:  ', "attribute2",
'

')

That worked in QGIS, but when I attempted to use this field to label with on my Mapbox map, the popup content showed up empty. Is that because it is a GeoJSON file?

I gave up on that method, and tried a different approach. This is my most recent attempt:

var strawberries = L.mapbox.featureLayer()

strawberries.loadURL('strawberries2.geojson');
strawberries.on('ready', function(layer){
    this.eachLayer(function(marker) {
      marker.setIcon(L.mapbox.marker.icon({
          'marker-color': '#4e779a',
          'marker-size': 'small',
          'marker-symbol':'building'
      }));
      marker.bindPopup('' + marker.feature.properties.Stand_name + '', '<italic>' + marker.feature.properties.Address + '</italic>', { closeButton: true });
    });
  });
strawberries.addTo(map);

It 3/4 works. I click the symbol, and get a popup that has a bold title of the farm name, but no address information. How can I concatenate more fields?


texts: Displaying adjacent polygon lines beside each other instead of overlapping

texts: I would like to display adjacent polygons with the line work beside each other, not one on top of the other for that shared boundary.  I do not want to edit the polygon boundaries - only want to change the way they are displayed. Is that possible?


texts:
I'm trying to add a value to an L.imageOverlay in leaflet. When you add the layer on the layer control panel, it adds the value using the function below to the total, I've tried it with an attribution, but this doesn't seem to work either. Is it possible to add data to the L.imageOverlay?

var EXVOORh01 = L.imageOverlay("EXVOORh.png", bounds, value="400000", onchange=totalIt());

  function totalIt() {
    var input = document.getElementsByClassName("leaflet-control-layers-selector");
    var total = 0;
    for (var i = 0; i < input.length; i++) {
      if (input[i].checked) {
        total += parseFloat(input[i].value);
      }
    }
    document.getElementsByName("total").value = "A" + total.toFixed(1);
  }


texts:
I am looking for an open source offline software to record points of interest that I might visit at a later date.
Let's say I am reading a book about Alaska, I'd like to take notes about interesting places, probably with the help of google maps to locate them on the map. Later I'd like to review the points, select the best ones and plan my vacation.

Important are a simple and quick input of positions, for example cut and paste urls from google maps, and the possibility to add annotations.

Trip planning and export to gps would be great, but if it can work with another program for planning, I'd be fine with that.

I'd like to keep it offline and open source as it may take a few years till I get to the marked points, and I don't want to rely on / trust an online service either.


texts:
When I add a new shape layer or want to edit an existing one, nothing is happening. I even don't see the dots where I'm clicking.

Maybe the problem is I deleted some layers (by opening the .qgs as a txt-file) as my project was collapsing by opening. I deleted three layers (maplayer and legendlayer, from start to end). Could there be some problem. The file is at https://dl.dropbox.com/u/83565282/AA_SR_Mendae.qgs

When I open a new project everything is fine.

Thanks a lot for all your help!!

I'm using QGIS 1.8.0 Lisboa


texts: Render and style multiple geometry features in OpenLayers

texts:
Using OpenLayers 4.2.0.

I have a feature with two geometries:

var feature = new ol.Feature({
  geometry: new ol.geom.Polygon(polyCoords),
  labelPoint: new ol.geom.Point(labelCoords),
  name: 'My Polygon'
});

Is it possible to render all of them at a time and style each geometry individually? Particularly I need to render the geometry and display the name in the labelPoint.

If I set a style to the feature it is applied to the geometry only. See this fiddle.

I also tried it via geometry collection

var feature = new ol.Feature({
  geometry: new ol.geom.GeometryCollection([
    new ol.geom.Polygon(polyCoords),
    new ol.geom.Point(labelCoords)
  ]),
  name: 'My Polygon'
});

but in this case the name is rendered twice. See this fiddle.


texts: Where can I find the source code of shapely.geometry.multilinestring.interpolate() function?

texts:
When I use shapely.geometry.multilinestring.interpolate() function, it creates points at every 50 m along the multiline.

I try to create a points at a given interval (lets say the distance between points will be 50 meters). And all these points will be on the multiline even in the vertex

I thought I may modify the shapely.geometry.multilinestring.interpolate() function, but I could not find it.


texts:
Does anyone know if there is an opportunity to add icons for your own plug-in in its own repository? like this

not like this

with green puzzle

other illustration

I spied on how to implement it on the official website here (view-source). File plugins.xml including the tag contains for example

<icon>/static/packages/2015/icon_217.png</icon>

where I added a similar relative path to my image (with and without leading slash)

<icon>/favicon.png</icon>,

but it does not appear in the list of plugins.
I did absolute path

<icon>http://foo.bar.spam.ru/favicon.png</icon>

but nothing had changed.


texts: Why is “Clip vector by extent” converting my vector to ISO-8859 encoding?

texts:
I’m using the extents of one vector to clip another, using GDAL Vector processing “Clip vector by extent” function. Both vectors are encoded as UTF-8. So why the resulting vector is encoded as ISO-8859-1, although my Linux system also uses UTF-8 as default?
I’ve seen similar questions, but my version of QGIS (3.18.1-Zürich) does not have a Ignore shapefile encoding declaration under Settings, Options, Data sources, Data source handling, nor do I find an “Encoding” option under project properties.