texts: Autocompletion with control element types of the attribute form in PyQGIS

texts:
With this code you can open a window with a LineEdit, which offers an automatic completion (here index 0).
    my_vector_layer = iface.activeLayer()
    w = qgis.gui.QgsFieldValuesLineEdit()
    w.setLayer(my_vector_layer)
    w.setAttributeIndex(0)
    w.show()

I want to embed this in the object form that appears after adding an object. I'm struggling a little with the PyQGIS documentation.
So it's going in this direction:
iface.openFeatureForm(layer, feat, True)

How do I get the above code embedded in openFeatureForm?
Generally I want a link with the attributes of another layer. Without PyQGIS this is possible in the layer properties under attribute form and value relation. But how do I address this and the other control element types of the attribute form in PyQGIS?


texts: Using Path Distance to Calculate Total Accumulated Cost from Source to Destination?

texts:
I am looking to calculate the total accumulated cost associated with traveling from a source point to a destination point (please see the included figure below, green dot = source, red dot = destination). I would like to use the ArcGIS "Path Distance" tool because I am interested in including horizontal factors associated with traversal as well as friction values associated with my cost surface (the cost surface is visible in the picture).

I'd like to know if it is possible to calculate total accumulated cost to my specific destination point, instead of just creating a path distance raster that calculates accumulated cost for the entire region. I have used the path distance raster and accompanying backlink raster as inputs for a least cost path, but I am getting an error output from Arc. The error message is general, and only states "failed to execute costpath".

How do I solve this issue?

I am using ArcGIS Desktop 10.6, and can use Python if it will be of assistance.


texts:
I'm running
QGIS version    2.8.1-Wien  QGIS code revision
Compiled against Qt 4.8.6   Running against Qt  4.8.6
Compiled against GDAL/OGR   1.11.2  Running against GDAL/OGR    1.11.2
Compiled against GEOS   3.4.2-CAPI-1.8.2    Running against GEOS    3.4.2-CAPI-1.8.2 r3921
PostgreSQL Client Version   9.3.5   SpatiaLite Version  4.2.0
QWT Version 6.0.2   PROJ.4 Version  480
QScintilla2 Version 2.8.4

on OSX 10.10.3 and the QGIS has of late become very slow. I don't mean functions are slow I mean simply clicking around on the GUI. I know QT4 sucks but it never used to be this bad. Is anyone else experiencing this and, more to the point does anybody have a solution?


texts: SLD Pointsymbolizer with color ramp based on first random attributes

texts:
The company I work at does drillings all over the country. These drillings are then presented as a service. So obviously this layer needs an SLD. For the moment every drilling is a green point, but we would like to go a bit more complicated.
The latest idea was to the following:
From a certain scale we'd like to let predetermined colors be filled for every dossier. One dossier can contain multiple drillings, but every drilling has a field which clearly notes that dossier.
I've determined the scale, that's no problem, but I have no clue of how I can add a different color to every dossier grouped point currently in the screen.

Anyone have a clue to how this could be worked out?


texts:
I am looking for a simple example to create a conditional statement in the pyQGIS console.
Today I wrote a simple script to add a field [CAT] to a vector layer. This script can be found below. I want to add a conditional statement to this script based on the field [SURFACE] to make the following statement:

If [Surface] > 10000: return "big city" to field [CAT]
Elif [Surface] > 10000: return "metropolis" to field [CAT]
Else: return "small city" to field [CAT]

SCRIPT:
fn = path to the file

layer=iface.addVectorLayer(fn, '', 'ogr')
features=layer.getFeatures()
caps=layer.dataProvider().capabilities()

if caps&QgsVectorDataProvider.AddAttributes:
    res=layer.dataProvider().addAttributes([QgsField("CAT", QVariant.String)])
    layer.updateFields()


texts: TIGER Geocoder / PostGIS - get county from point

texts:
Looking for some help with getting the county for a lat/lon. I have PostGIS / TIGER Geocoder installed and can reverse look up a point and get the addresses. I would like to get the county the addresses are in.

I have...

geocoder=# SELECT pprint_addy(r.addy[1]) As st1, pprint_addy(r.addy[2]) As st2, pprint_addy(r.addy[3]) As st3,
    array_to_string(r.street, ',') As cross_streets
    FROM reverse_geocode(ST_GeomFromText('POINT(-77.03 38.90)',4269),false) As r;
            st1                 |            st2             | st3 |   cross_streets
------------------------------------+----------------------------+-----+--------------------
New York Ave, Washington, DC 20005 | H St, Washington, DC 20005 |     | H St NW,13th St NW

(1 row)

And would now like to get the county for that point.


texts: Im relatively new to QGIS and would like to know whether or not I can save my form annotations to a layer so I can turn them on or off.


texts: Problem by using PostgreSQL type PATH with SQLAlchemy

texts:
I have a PostgreSQL table below with a field coordinates of type path:

CREATE TABLE geometry
    (
        id serial not null primary key,
        coordinates path not null
    );

And I am trying to handle this table with the following python class below:

class Geometry(Base):
    __tablename__ = 'geometry'

    id = Column(Integer, Sequence('geometry_id_seq'), primary_key=True)
    coordinates = Column(String, nullable=False)

Trying to add a Geometry into the table:

session.add(Geometry(id = 1, coordinates = "path('(15.234428926980286, 47.95865145177352)')"))

I am getting this error:

  invalid input syntax for type path: "path('(15.234428926980286,
  47.95865145177352)')


texts: Looking for local data sets for 6th graders?

texts:
I am a newcomer to GIS, and am looking for local data sets to use with my students.  I would like to locate data on our state, county, and city levels (for city, things like parcels, subdivisions, etc.).  I am aware of some of the more global sets that would apply equally to localities around the world, but I'm looking for stuff that would be almost hyper-local.

I am in Oakland County, Michigan.

How can I find data sets that would be relevant to my students?


texts: Designing my own icon for use in OpenLayers implementation

texts:
I have been searching for a simple way to create an icon to add to my OpenLayers implementation.

Currently I have an implementation I found in the documentation which utilizes a png file, but I was wondering if it isn't possible to style a regular circle and give it a color of my own desire?

I my current implementation I have is:

//setting location of marker
var location = new ol.Feature({
    geometry: new ol.geom.Point(ol.proj.fromLonLat([longitude, latitude]))
});

//styling marker
location.setStyle(new ol.style.Style({
    image: new ol.style.Icon({
        color: '##4271AE',
        crossOrigin: 'anonymous',
        src: 'https://openlayers.org/en/v4.2.0/examples/data/dot.png'
    })
});

I am having a lot of markers close to each other and by using the code above my markers appear as follows:

I guess I could just scale them using

new ol.style.Icon({
    color: '#4271AE',
    crossOrigin: 'anonymous',
    src: 'https://openlayers.org/en/v4.2.0/examples/data/dot.png',
    scale: 0.25
})

But basically what my problem is, is the outline (stroke) on the circle. I guess I could style my own white circle, in a regular drawing program and use that, but I find that quite cumbersome considering I am just wanting to create a colored circle. I would assume this was implemented in OpenLayers, but I can't find any documentation supporting this.


texts: How to display a single in a group of nodes with same attributes?

texts:
In QGIS, if I have some nodes with a name attribute is there a way to display only one node that would be in the middle of this group of nodes having the same name?

For example, let's say i have 3 nodes with an attribute "ABC" I would like to display one node what would be in the middle of this group.


texts: Converting KML Html Popup attributes as shapefile attributes?

texts: How to convert KML Popup info into shapefile attributes while kml to shapefile conversion by using QGIS or any software.


texts: Calculation to convert db data to Lat/Lng degrees

texts:
In a database I have the following Lat/Lng data. I wish to convert it to a readable format.

177514245:34726053  =>  S 32 7.3947, E 115 51.4245
177513828:34726948  =>  S 32 7.3052, E 115 51.3828
177508930:34829424  =>  S 31 57.0576, E 115 50.8930
177508084:34829842  =>  S 31 57.0158, E 115 50.8084
177504234:34831118  =>  S 31 56.8882, E 115 50.4234
177504474:34831039  =>  S 31 56.8961, E 115 50.4474
177507746:34829955  =>  S 31 57.0045, E 115 50.7746
177504623:34830989  =>  S 31 56.9011, E 115 50.4623
177507014:34830191  =>  S 31 56.9809, E 115 50.7014
177506702:34830295  =>  S 31 56.9705, E 115 50.6702

I was given the formula for converting the db data o the readable format but lost the information after a hhd failure.

The number before the ':' becomes the Lng and the second the Lat.
I don't want to through any red herrings into confuse anyone, but this is what I can remember.

Apparently this is a common format.
The raw Lat and Lng number was subtracted by a constant. I can't remember if they were the same, and then divided to give degrees and minutes.

But take that all with a grain of salt.

Thanks in advance,
Simon

I have no idea. The data in the db is the 18 varchar figure. The OEM software represents the coordinates in the format as shown above.
Have been Google ing it for 3 days and have found nothing. Can't remember the site I posted the question on about 3 or 4 years ago so I could go back and read it again.
At the time I was told it was a pretty common method of storing coordinates.
The db is sqlite, I use RAD Studio.

The OEM GUI that displays the data doesn't allow me to access the data through it. But I can read/write the db itself and I wish to map the coordinates. Hence the need to be able to make sense of how:

177514245:34726053

becomes

S 32 7.3947, E 115 51.4245


texts: Re-ordering text strings within field using Python Parser of Field Calculator

texts:
At ArcGIS 10.8.1, I have a shapefile attribute table containing a text field with names ordered last, first, middle, as in this example:
Smith Sally J
Doe John
Jones William Randolph
...
I need to reorder the names so that they are listed as first, middle, last:
Sally J Smith
John Doe
William Randolph Jones
...
I think that moving the first text string (i.e. the last name) to the end would solve the problem.
I've attempted to reorder the names into a second, empty text field using the Field Calculator, without success.  In particular, I've looked into the Python .split() function, but am stymied with how to move the first text string to the end.


texts: Is it possible to provide proxy.ashx for the other domain?

texts:
Usually, we use proxy.ashx for the same domain by this code. (working well.)

esri.config.defaults.io.proxyUrl = "proxy.ashx";
esri.config.defaults.io.alwaysUseProxy = true;

If the other domain need to use my proxy, is it possible to provide proxy.ashx for the other domain?

I have try from my localhost but not working

esri.config.defaults.io.proxyUrl = "http://www.mydomain.com/proxy.ashx"; //can't access
esri.config.defaults.io.alwaysUseProxy = true;


texts: QGIS removes id field when saving as GeoJSON

texts:
I have a GeoJSON file of points which I am editing using QGIS 2.16.1.

{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },

"features": [
{ "type": "Feature", "id": 1, "properties": { "geo_code": "E02002536", "avslope": 0.710642 }, "geometry": { "type": "Point", "coordinates": [ -1.295758646546615, 54.610678649992742 ] } },
{ "type": "Feature", "id": 2, "properties": { "geo_code": "E02002537", "avslope": 0.614510 }, "geometry": { "type": "Point", "coordinates": [ -1.277248239209249, 54.611301122046676 ] } },

After eding the file and using the Save As feature the id field has been removed

{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },

"features": [
{ "type": "Feature", "properties": { "geo_code": "E02002536", "avslope": 0.710642 }, "geometry": { "type": "Point", "coordinates": [ -1.295758646546615, 54.610678649992742 ] } },
{ "type": "Feature", "properties": { "geo_code": "E02002537", "avslope": 0.614510 }, "geometry": { "type": "Point", "coordinates": [ -1.277248239209249, 54.611301122046676 ] } },

I need this field, and it is part of the GeoJSON standard. Is it possible to save the file and include the id field. I have tried using the Attibute editor but the changes are made within properties not at the top level.


texts: Using level information from OpenStreetMap to show roads / tunnels / bridges in right level?

texts:
OSM has information about the levels of road segments for example road crossing railway.

It is possible to order layers dynamically from the level attribute?

I only found one possibility in QGIS to order layers, but they are fixed and only manually set.


texts: Citing/attributing Google basemap in QGIS for research paper

texts:
I have searched Google for how to cite a Google base map in QGIS for a research paper and I cannot find the correct website for their rules for attribution.
Can somebody quickly link me to their website where it tells me what I have to say or have to annotate on the map itself (e.g. "(c) Google 2020") or do I not have to do this for a journal research paper under creative commons licenses, non-commercial projects, etc.?
I am trying to use the base map "Google Map Satellite". I can't find any attribution in the map layer metadata itself either
Also for the sake of helping other people out, what are the websites and/or procedures for citing ESRI and OpenStreetMap base maps?


texts: How to sum up two images on Google Earth Engine

texts:
How can I sum up two bands of different images using Google Earth Engine.
I uploaded two images to the GEE, but I would like to know how to do the sum between them: image1 + image2 = image3.
I try, but fail
var image3 = ee.ImageCollection('image1', 'image2').merge(sum)


texts: Clip rasters and vectors simultaneously in QGIS 2.18

texts:
I am trying to clip an aerial map in QGIS 2.18 with the layers simultaneously in this map:

My purpose is to get the aerial map clipped by the red layer that includes all layers like this image (i did that image with draw software):

whereas the result of the clipper is without the blue circle layer:

The clip function in: vector-> processing tool-> clip, clips only vectors.

In Raster-> clipper, it clips only raster by the mask layer.

In ArcGIS 10.3 this function is called "clip to shape" and the whole map- rasters and vectors been clipped by polygon shape.

Is there an equal function to "clip to shape" in QGIS 2.18 the same as in ArcGIS?


texts: How to check active users of ArcGIS 10.2 Floating License with python 2.7?

texts:
I want to find the users who are using ArcGIS 10.2 license with python script.
Also, what kind of license they are using. Is it possible to get the number of users which are connected to ArcGIS server but inactive or not using it so that I can disconnect those user to free the license for the other users who really need it.


texts: Find the intersecting polygons between 2 tags in OpenStreetMap using Overpass API?

texts:
I need to find in Italy all the intersecting polygons of:

all airport terminals of the tag["aeroway"="terminal"] that are inside only international airports of the tag["aerodrome"="international"]

I have reached this level:

area["name"="Italia"]->.boundaryarea;
(
 (way(area.boundaryarea)["aerodrome"="international"];  rel(area.boundaryarea)["aerodrome"="international"];)->.a;
 (way(area.boundaryarea)["aeroway"="terminal"];  rel(area.boundaryarea)["aeroway"="terminal"];)->.b;

 (rel.a.b;  way.a.b;);
);
/*added by auto repair*/
(._;>;);
/*end of auto repair*/
out meta;

but still it does not show the intersections but not the union and it shows me the intersection between all.


texts: What is directed principal component analysis?

texts:
Is there any difference between directed principal component analysis and  principal component analysis?

If yes how (which software) can I perform the first one?


texts: PostGIS: Update table with st_geometryfromtext

texts:
I'm trying to update a column wkb_geometry in a table locations by creating a point from the eastings and northings cols from the same table. The database is PostGreSQL with PostGIS extension:

UPDATE locations
SET wkb_geometry = st_geometryfromtext('POINT(locations.easting locations.northing)',2770);

I'm getting the following error:

ERROR: parse error - invalid geometry
SQL state: XX000
Hint: "POINT(lo" <-- parse error at position 8 within geometry

The column has been added like this:

ALTER TABLE locations ADD COLUMN wkb_geometry geometry(Geometry,27700);

I suspect that locations.easting and locations.northing are not being substituted with actual values from the respective columns but am not sure how to fix this. The answer I'm after will show how to substitute the easting and northing string with actual values from the column


texts:
I have a polygon shapefile which I'd like to rotate 90 degrees about the x-axis in 3d. The polygon is currently flat (projected in plan view), I'd like to project it vertically. Specifically, this is a geologic cross section currently projected with depth on the Y-axis - I want to turn the polygon into it's proper Z-orientation.

I have access to 3d-analyst and ArcScene, AutoCAD.


texts: Converting binary TRMM to GeoTIFF using R?

texts:
I´m trying to convert a binary image of TRMM satellite to Geotiff format using this R code:

setwd("C:/Users/Hugo/Desktop")
trmm.data.file<-"C:/Users/Hugo/Desktop/3B42_daily.2013.04.22.7.bin"
trmm.data<-readBin("3B42_daily.2013.04.22.7.bin", "numeric", size=4, signed = TRUE, n = 1440 * 400, endian = "little")
trmm.array <- array(trmm.data, dim = c(400, 1440))
trmm.raster <- raster(trmm.array, xmn = -180, xmx = 180, ymn = -50, ymx= 50, crs = '+proj=longlat +datum=WGS84 +ellps=WGS84')
trmm.crop<-crop(trmm.raster, e)  # 'e' is the box of my region of interest
plot(trmm.crop)
setwd("C:/Users/Hugo/Desktop/")
writeRaster(trmm.crop,filename="trmmcrop.tiff",format="GTiff",overwrite=TRUE)

But it seems not to work, the pixel values are incoherent and the resolution is wrong.

Any idea about how to do this?


texts: Permanently reordering fields in data (shp, gdb) without using FME or another ETL tool

texts:
If I have a shapefile or geodatabase featureclass that has fields that I want to permanently reorder, is there a tool, script, or utility that will help me quickly accomplish this task?
Generally I know you have to create a new field, then populate it with the old values, then delete the old field.  I am hoping there is something already created out there that will help with this.
Assuming you don't have FME or another ETL tool available, what is the next best suggestion?
This is NOT a view level change (ie- drag/drop the fields in order), but rather write out to a new shapefile or featureclass.


texts: QgsTask in PyQGIS Standalone Application

texts:
I'm playing around with the task examples from the QGIS documentation: https://docs.qgis.org/3.4/en/docs/pyqgis_developer_cookbook/tasks.html

Besides the typo at the bottom (dosomething instead of doSomething) I haven't changed the code. But no matter which of the methods I use, I always get this error in the console:

  QWaitCondition: Destroyed while threads are still waiting

This only happens in my standalone application. In the python console inside of QGIS it works. What's my mistake? I'm working with QGIS 3.4


texts: How to find the best location to put a facility within network so that all points are near a facility?

texts:
Suppose I have many points distributed in a network. I want to place three facilities in the best way so that all points are near a facility.

How can I do it? Any solution and software should be fine (QGIS, ArcGIS Network Analyst, pure C/Python/Java algorithm).


texts: FME BATCH: How to create a "LOG" in a specific file output

texts:
I created a Batch that looks like this :

>     FOR %%D in ( Paris Pas-de-Calais Pyrenees-Atlantiques Pyrenees-Orientales) DO (
>     fme.exe jointure_cana_region_dep.fmw
>     --SourceDataset_SHAPE "W:\LAB\OAD\G@zmaps\DATA\SHAPES\CANALISATIONS_SIG\SIG
> V0_022013\INPUTS\cana_departements\%%D.shp"
>     --DestDataset_SHAPE "W:\LAB\OAD\G@zmaps\DATA\SHAPES\CANALISATIONS_SIG\SIG
> V0_022013\OUTPUTS"
>     --LOG_FILE %%D.log )
>
>     pause

My question is, Is there a Command Line that allows to create the LOGs in a specific file? because I know that they are created but I don't know where ?
I tried this command :

> --LOG_FILE "W:\LAB\OAD\G@zmaps\DATA\Workspaces\STEP1_DECOUPAGE_CANA_DEP\Jointure_cana_dep_V0\LOG\%%D.log"


texts: FME: floating point precision issues (ArcSDE / FGDB)

texts:
I am working on a (generic) FME Workbench that clips and exports data from ArcSDE database into the File Geodatabase (FGDB) format.

The SDE features are clipped using an AOI, that arrives in the workbench in the form of an ESRI JSON parameter. The ESRI JSON string / AOI is converted into a FME geometry using a ‘GeometryReplacer’. So far, so good.

AOI = {"rings" :[[[131064.8258, 451340.5549], [131064.8258, 454729.4129], [135194.9964, 454729.4129], [135194.9964, 451340.5549], [131064.8258, 451340.5549]]],"spatialReference" :{"wkid" : 28992}}

The first thing I notice is that after interpreting the AOI as a FME geometry some floating point differences occur. Which are not really a reason for concern at this point.:

Figure 1 - AOI coordinates after interpreting the geometry.

The next step is to clip features from ArcSDE using the AOI. Actually I am also interested in the features outside the project area that are intersecting the AOI, since the original shape of the features will be restored in another process.

Figure 2 - Result of the clipping process.

In Figure 2 above, the results of the clipping process is presented. So far, so good. On the ‘clipping line’ new coordinates are added which get known values from the AOI. (xmax 135194.9964).

During the next step, the features are written to separate FGDB’s (exportinside.fgdb and exportoutside.fgdb) (based on an XML template extracted from SDE), with the exact same precision and domain settings etc.

Figure 3 - Feature 'outside' as stored in FGDB.

Figure 4 - Feature 'inside' as stored in FGDB.

In the above figures the features are extracted from the FGDB’s. As you can see the coordinates are changed to 135194.997000000137 and 135194.99639999886. I do understand that the coordinates can be changed while writing them to FGDB, due to the precision and domain values. What I do not understand is that the same coordinate is stored different for both features.

The (received) AOI clipper is not necessarily on the same scale and precision as the clippees / features that are extracted from the ArcSDE. In most cases the AOI will origin from ESRI Workflowmanager, but actually the workbench should be able to support any ESRI JSON polygon as AOI.

Improvements that I already made:
•Use XML template for both FGDB’s (based on origin SDE).
•   Experimented with preprocessing the AOI by using the CoordinateRounder, ArcSDEGridSnapper and AnchoredSnapper.

I really need to have full control over the coordinates after clipping and exporting. The coordinates of the new vertexes that are introduced because of the clipping need to be (stored) exactly the same for both the exportinside.fgdb and exportoutside.fgdb. Also I need to be able to ‘gridsnap’ the AOI before clipping, so that I can predict what the coordinates will be. Because of the slight changes I am not able to use the data in  the next steps, e.g. within spatial filters.

I don’t understand why I am not able to fix this by using the ArcSDEGridSnapper to ‘project’ the AOI and the  XML templates control the FGDB’s.

Figure 5 - ArcSDE and FGDB settings.

Figure 6 - ArcSDE Domain, Resolution and Tolerance

Figure 7 - ArcSDEGridSnapper settings


texts: Why are ArcGIS Online Feature Layers so Big Compared to their Source?

texts:
I am uploading a file geodatabase to ArcGIS Online that is 40MB when unzipped. The resulting feature layer is 170MB. Why is the feature layer so much bigger than the source data? I don't remember running into this in the past. Has there been a change in the last few months?

It appears that the line geometries are taking up about 4.5 times as much space as an AGOL feature layer than as a file geodatabase or shapefile.


texts: How to make a QGIS 3 Layer refresh after a joined data source is updated

texts:
I have a layer of ZCTA features that is sourced from a SpatiaLite table that is joined to an Excel spreadsheet and rendered with categorized symbology.  That all works fine. The join configuration is:

I have found that after I edit the spreadsheet (using the column that the categorized renderer uses), I can turn the layer off, and then turn it on again.  And the layer will refresh and change color. But only once.  Subsequent updates to the spreadsheet do not trigger any changes in the QGIS Layer.

I am setting up this project for a non-GIS user, so I'm hoping to avoid any PyQGIS as presented in these answers: Make a Qgis layer update from a changed data source

Does this capability exist in QGIS 3? Something like an "Update All Data Sources" for a selected layer?


texts: Error when exporting Query Layers and Event Layers to Feature Class from ArcMap

texts:
ArcEditor 10.2.2 and 10.2.0
SQL Server 2008, service pack 4

We have Query Layers and Event Layer point layers in ArcMap, which have been created from tables in a  SQL database. The layers can be displayed and symbolized in ArcGIS, but when trying to export to a file geodatabase Feature Class or a shape file we often get the error below, or get no error, but the output is blank (no data). This issue is not consistent, sometimes is working and sometimes not working.

Does anyone experience this error and know the solution?


texts: Dissolving/Unifying Ill Behaved/Irregular Polygons in R

texts:
I'm working on a project involving bringing together multiple subjects circling difficult to find parts of an image. The output from users is pretty awesome.

Cool, right?

However, what I want is to get the area of the image that has 1, 2, 3, 4, etc. users selecting it. And I'm using R for the analysis with the sp, raster, and maptools packages (with a little rgeos throw in when need be). Essentially, my workflow is to
1) create a single polygon from each user's input (I actually have the track of each individual selection per user, but it seemed easier to combine them into a single SpatialPolygon per user)
2) merge them all together into a single SpatialPolygonsDataFrame Object
3) Rasterize the object using the count function
4) Assess area of the raster with n number of users selecting it

Here's the output SpatialPolygonsDataFrame to play with

This works great, but is slooow due to the rasterization. I feel like I should be able to do something with the SpatialPolygons object. And I've tried a few things with union, gIntersects, gUnion, and intersect. However, I keep getting errors such as the following

Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_lower_td, "rgeos_difference") :
TopologyException: Input geom 1 is invalid: Self-intersection at or near point

Fair enough. Often a given users SpatialPolygons are invalid when I test them using gIsValid. Looking at, say, just the first two, this becomes obvious that there are many overlapping points.

You can see the intersecting points pretty clearly. Furthermore, in poly2 (the blue) there appears to be some self-intersection, causing gIsValid to return false.

I've also tried unionSpatialPolygons (with avoidRGEOS=T) which creates a unified object

  unionSpatialPolygons(polysData[1:2,],
  IDs=names(polysData[1:2,]@polygons))

But the borders still overlap like in the above image, rather than being one smooth polygon outer border - i.e., the polygons are not dissolved together. Then using any further functions on this new SpatialPolygons object, I have the same problems.

So, is there a way to use polygons instead of going to rasters? It sure would make my life faster, which would be excellent.  I feel like this must be a common problem with a wheel invented that I have yet to find. Thoughts?


texts: creating a new layer based on colour characteristics

texts:
I have 14 polygon layers. I have plotted them as transparent layers, so I can get a final layer with 6 different colours, which represent different categories. I want to create a new layer made by the 14 layers, but keeping the 6 different colours. The main problem is that the colours in the original layer aren’t attributes of the layers but that’s a single representation, so when I try to reclassify them or use the raster calculator, the final result is not useful at all. I have attached one image and the 14 transparent layers together, with the 6 different colours (light, medium and dark green and light, medium and dark red).

Someone knows how to get a single layer which allow to classify it in those 6 categories?


texts: Geoserver's scale values corresponds to OL's zoom levels

texts:
I have a PostGIS table that contains geometry, min_scale, and max_scale fields. The PostGIS table is published as a Geoserver layer with EPSG = 4326. I have created a CSS Style Doc that will show each geoemtry only in its scale range; something like:

[@sd <= max_scale] [@sd >= min_scale]{
     mark: symbol(circle);
}

My problem is how to set the min_scale and max_scale fields to work properly with Openlayers zoom levels. I tried to use the scale values from the EPSG:4326 Gridset:

http://localhost:8080/geoserver/web/wicket/bookmarkable/org.geoserver.gwc.web.gridset.GridSetEditPage?6&gridSet=EPSG:4326

But it didn't work properly; for example if I set

min_scale = 545978  which corresponds to zoom 9

max_scale = 2183915 which corresponds to zoom 7

The feature appears only at zoom 7 and 8, and didn't appear at zoom 9.

I also tried the values at this table (Default Gridset):

https://docs.geoserver.org/latest/en/user/styling/ysld/reference/scalezoom.html#default-gridset
But the same problem occurred.

My question is what is my problem? which scale values should I use in order to work properly with Openlayers zoom levels?


texts:
Please look at https://stackoverflow.com/questions/29655662/dynamic-styles-in-openlayers-3 and https://stackoverflow.com/questions/33251893/how-to-dynamically-style-cluster-layer-without-style-function.

I have a Vector layer with some features I load from a server in GeoJSON format.

    var vectorSource = new ol.source.Vector();

    var features = new ol.format.GeoJSON().readFeatures( featuresObj , {
        featureProjection: 'EPSG:4326'
    });

    for ( var i = 0; i < features.length; i++ ) {
        features[i].setStyle( defaultStyle );   // <<<< --- apply the default style
        vectorSource.addFeature( features[i] );
    }

    var vectorLayer = new ol.layer.Vector({
        source: vectorSource,
    });

As you can see I apply a default style to it.
The default style must have some attribute based configuration like:

new ol.style.Style({
       fill: new ol.style.Fill({
           color: ${fillColor},
       }),
       stroke: new ol.style.Stroke({
           color: ${strokeColor},
           width: 1,
       })
});

This worked nice until OL2.

Now you say "Yo man, just use the style function function(feature, resolution) and use each feature attribute in the style! Bind it to the vectorLayer..."

Here comes the problem....

I have a default style because I need other styles to be applied to the features later. I have to switch styles between default and selected when the user clicks on each feature to hilight them.

var select = new ol.interaction.Select();
map.addInteraction(select);

select.on('select', function(event) {
    var selected = event.selected;
    var deselected = event.deselected;

    selected.forEach(function(feature){
          feature.setStyle( selectedStyle );
    });

    deselected.forEach(function(feature){
          feature.setStyle( defaultStyle );
    });

});

I need to keep both styles dynamic because I'll not use the styles function anymore until I reload the entire layer.

I think removing the "${attribute_name}" dynamic value was a step back from the OL guys...

How can I do what I need?


texts: Adding linear distances along polyline segments (start/end stations) to attribute table in QGIS

texts:
This seems like a pretty simple application but I've been struggling to find the appropriate tool.
I have a polyline feature (a trail network) that contains fields with attributes about each segment of the trail.
(name, width, surface type, retaining wall type, etc.)
So a single trail may contain multiple segments if the properties of the trail change along the length.
I'd like to add fields that have the start/end stations for each polyline segment along each trail and then be able to export this table for some additional work in a spreadsheet.
It seems like I need to set up some type of routing information to define which polyline segments are part of the same route.
The linear referencing tool seems to almost do what I want, but I haven't been able to crack that.
Can you give me any tips on tools or appropriate terms to research?


texts: Wrong coordinates after loading OSM to postgre

texts:
After loading OSM data for whole Europe to postgres (Osm2pgsql) I'm trying to add them to Geoserver, but the coordinates are totally wrong. The SRS is correct (4326), but the coordinate values are oddly small.
Do you have any idea what i've made wrong? And how to change it?

More over the data is displayed not correctly. eg lines are not displayed as lines, but as squares, and other tables are the same (it looks more like some OSM data boundries). Does anyone know why?


texts:
I have a problem I'm trying to solve.
I want to join serval CSV files to a feature class, I would like to create one new feature class for each CSV files. If it's possible each fc would be named after the CSV file used.

For example if I have:
abc.csv and zxy.csv I want to feature class to be named , with each fc corresponding to one of the csv file, abc and zxy.

inFeatures = r"path to my feature class"
layerName = "fc_layer"
joinTables = r"path to the folder where my CSV files are"
joinFieldlyr = "CI_INT"
joinFieldtab = "CI"
outFeature = r"path to the folder dataset where I want my feature class"

arcpy.MakeFeatureLayer_management(inFeatures, layerName)
arcpy.AddJoin_management(layerName, joinFieldlyr, joinTables, joinFieldtab)
arcpy.CopyFeatures_management(layerName, outFeature)

That code work perfectly for one file but I can't get the name part right. I tried to use os.path.join and os.path.splitext so I can find and use the name of my files but without any succes.
I also tried to code a loop to iterate trough my folder so I don't have to do it manually.


texts: Calculating length of line shapefile using PyQGIS

texts:
I have two lines that overlap, so I clip the overlap, and I should get its length in kilometers.

The clip part is ok but I can't find any resources on how to get the length. It can be printed in the console or add a field in the clipped shapefile that contains the km length. I used Calculating line lengths using PyQGIS as a guide but it didn't work.
import processing
from PyQt5.QtCore import QVariant

overlay_layer = QgsProject.instance().mapLayersByName("route2")[0]
bottom_layer = QgsProject.instance().mapLayersByName("route1")[0]
overlap = r'C:\Users\imper\Documents\python\calculate_overlap_lines\overlap.shp'

# clip overlap - works
processing.run("native:clip", {'INPUT': bottom_layer, \
'OVERLAY': overlay_layer, \
'OUTPUT': overlap})
iface.addVectorLayer(overlap, '', 'ogr')

# get length - doesn't work
overlap_lyr = QgsProject.instance().mapLayersByName("overlap")[0]
for overlap_lyr in QgsMapLayerRegistry.instance().mapLayers().values():
    features = overlap_lyr.getFeatures()
    for f in features:
        geom = f.geometry()
        leng = geom.length()
        res = overlap_lyr.dataProvider().addAttributes([QgsField("Length", QVariant.Int)])
        overlap_lyr.updateFields()
        fieldIndex = overlap_lyr.dataProvider().fieldNameIndex("Length")
        attrFeatMap = {}
        attrMap = { fieldIndex : leng }
        for feature in overlap_lyr.getFeatures():
            attrFeatMap[ feature.id() ] = attrMap
        overlap_lyr.dataProvider().changeAttributeValues(attrFeatMap)

I'm getting this error raise QgsProcessingException(msg) _core.QgsProcessingException: There were errors executing the algorithm.


texts: Split line using line/point in PostGIS 1.5

texts:
I have a layer that contains a master line (one big polyline) and a another layer that contains "break lines".  I need to be able to split the master line at the intersection of each of these break lines.

I'm looking for a PostGIS 1.5 version of ST_Split.  If I could upgrade to 2.0 I would but can't really do that at this point in time.

I thought this would be relatively easy but can't seem to find anything; or when I do it's just related to polygons being split with polylines.

Note A spatialite answer is OK


texts: Example for creating tiles from image for use in mapbox-(gl)-js

texts:
I'm facing weird random tile selection issues (like floating precision causes a wrong tile to load) when using some existing static tile data with mapbox-gl-js.

I'm therefore searching for an example or tutorial for creating a tile set for usage with mapbox-(gl)-js. It seems to be some kind of implementation specific issue that my tile set doesn't work, even though it should be the right projection.


texts: Setting a label color of zoom extent in QGIS

texts:
I set a frame color of zoom extent at print layout-properties-overview when I use atlas.
How can I set a label color of the number this particular zoom extent to be the same as zoom extent frame?


texts: How to change layer’s CRS in order to buffer and intersect in QGIS?

texts:
I'm very new to QGIS (working with version 3.12).
I'm trying to create a buffer of rail lines, but it's coming out much larger than it should be, e.g. when I try to show a 500-ft buffer, it results in a large circle whose radius far exceeds 500 ft.
I changed the CRS of both the QGIS project itself and the line so that they match, but with the same result. I'm also trying to do an intersect overlay with a line and a polygon and while the resulting layer appears on the panel, it does not appear in the project itself. Again, I matched up the CRS's of the two layers but to no avail.
Something is telling me these two issues are linked. Which problem(s) might I be having? I've attached an image for reference; that little black dot in the middle of the circle are the zoomed-out rail lines from which I'm trying to create a buffer. Again I'm very new to this so please explain as simply as possible as there's quite a bit of terminology I'm not familiar with.


texts: Creating a new map frame: Error HRESULT E_FAIL has been returned from a call to a COM component

texts:
I am trying to create a new map frame in the PageLayout Control. But I got the error:  Error HRESULT E_FAIL has been returned from a call to a COM component at the method AddElement.

Please see below codes:

                    IEnvelope envelope = new EnvelopeClass();
                    envelope.PutCoords(Upper_LeftX, Upper_LeftY - _Height, Upper_LeftX + _Width,
                        Upper_LeftY);

                    IMap map = new MapClass();

                    IMapFrame mapFrame = new MapFrameClass();
                    mapFrame.Map = map;
                    IElement mapElement = mapFrame as IElement;
                    mapElement.Geometry = envelope;

                    pageControl.ActiveView.GraphicsContainer.AddElement(mapElement  , 0); // throw error
                    pageControl.ActiveView.FocusMap = mapFrame.Map;
                    pageControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);

Do you know why ?

Thanks and regards,

Tai


texts: GRASS 7 Cost surface and elevation points development

texts:
I'm a new to GIS and I'm trying to develop an optimal path across an area by using GRASS 7 features.

It is very similar to the task given here.

The problem is that I don't have any data with elevation points and cost surface for this area.

How can I create a raster with the cells showing low-high travel costs and how can I set an elevation points?


texts: OGR merge shapefiles of different geom type into a single GeoJSON feature collection

texts:
I'd like to merge shapefiles of different geometry types into a single geojson feature collection, but OGR says it doesn't support update of GeoJSON files:

$ ogr2ogr -f GeoJSON -t_srs crs:84 -lco GEOMETRY_AS_COLLECTION merge.geojson points.shp
$ ogr2ogr -f GeoJSON -t_srs crs:84 -update -append merge.geojson -lco GEOMETRY_AS_COLLECTION lines.shp -nln merged
ERROR 4: GeoJSON Driver doesn't support update.
FAILURE:
Unable to open existing output datasource `merge.geojson'.

This seems like a common use case to me. Am I missing something obvious in the ogr2ogr manual? I can put together something in python (and finally use fiona) but I'm rather surprised I don't see anything existing when searching here or github... which makes me thing I'm messing something up.

thanks!


texts:
>>> import arcpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Program Files (x86)\ArcGIS10.5\Desktop10.5\ArcPy\arcpy\__init__.py", line 22, in <module>
    from arcpy.geoprocessing import gp
  File "D:\Program Files (x86)\ArcGIS10.5\Desktop10.5\ArcPy\arcpy\geoprocessing\__init__.py", line 14, in <module>
    from _base import *
  File "D:\Program Files (x86)\ArcGIS10.5\Desktop10.5\ArcPy\arcpy\geoprocessing\_base.py", line 14, in <module>
    import arcgisscripting
ImportError: DLL load failed: The specified module could not be found.

What does it mean?

By the way,I have downloaded python 3.7 for studying, which means I may have two python interpreter in my system.

Is it the reason I can't import arcpy?


texts: Cutting off polygons that exceed world boundaries in QGIS?

texts:
I have some polygons that exceed the boundaries of the world map on the latitude. Basically, they stick out of the world map overlay at the left and right side of the screen. This is causing them to overlap when I load them in the software I use the view the exported shapefile.

I got much more polygons than in this mockup but I cannot share the original data. I use diffuse to create a single outline.

The problem is that the green and red polygons create an overlap in my shapefile viewer because they exceed the world map.
In the case of the green polygon, the problem can be solved if there is a way to cut off the data beyond the world map because the shape is the same.
In case of the red polygon, the part that is outside the world map doesn't exist at the right side of the screen so somehow that part can't be cut.
The part that overflow needs to be copied to the left side of the world map or the overflowing data should not create overlaps.

Basically, I want to create outlines only polygon. This is working, except for those couple of polygons that create overlap because they exceed the world map.


texts: Creating labels with Umlauts, accents, etc. in QGIS

texts:
I have a problem labeling features with special characters like French accents, umlauts, etc.

I have the names in the attribute table, but names like Niafunké are displayed Niafunk�. I assume it has something to do with character coding, but where can I change that in QGIS?


texts: Unable To Clean Incorrect Geometries with Grass?

texts:
Software:
QGIS 2.18.10
GRASS GIS 7.2.1
GitHub Repository Link: Police

Having difficulty fixing incorrect geometries for nypolicew84.zip shapefile (check GitHub link)
Errors when using GRASS to fix issue. Is there anything I am missing? Or is there a more straight-forward way to fix shapefile. Please assist.
QGIS file also in GitHub
Below are the steps:
1. Open Topology Checker

2. Click on Configuration

3. Select must not have invalid geometries

4. Rule gets added

5. Click on Validate All

6. Error Found

7. Zoom in to see all errors

8. Open GRASS GIS and set location

9. Follow prompts to set location. Kept at default

10. Keep EPSG

11. Select EPSG 4326

12. Get Unlabeled Error

13. Finish is grayed out


texts: Convert jp2 file and jgw file in GeoTIFF using GDAL

texts:
I have one file .jp2 and one file .jgw and in this file I have all coordinates :

.jgw :

0.0500000000
0.0000000000
0.0000000000
-0.0500000000
426600.0250000000
6717999.9749999996

What method should I use to convert .jp2000 format with my .jgw to geotiff with using this command?

gdal_translate IN.jp2 OUT.tif

EDIT :

Logs gdal_translate :

Input file size is 4000, 4000
ERROR 1: PROJ: proj_get_ellipsoid: CRS has no geodetic CRS
ERROR 1: PROJ: proj_get_ellipsoid: Object is not a CRS or GeodeticReferenceFrame
ERROR 1: PROJ: proj_get_ellipsoid: CRS has no geodetic CRS
ERROR 1: PROJ: proj_get_ellipsoid: Object is not a CRS or GeodeticReferenceFrame
0...10...20...30...40...50...60...70...80...90...100 - done.

Logs gdalinfo :

Driver: JP2OpenJPEG/JPEG-2000 driver based on OpenJPEG library
Files: 2018_4266-67180_050.jp2
Size is 4000, 4000
Coordinate System is:
ENGCRS["unnamed",
    EDATUM[""],
    CS[Cartesian,2],
        AXIS["(E)",east,
            ORDER[1],
            LENGTHUNIT["unknown",1]],
        AXIS["(N)",north,
            ORDER[2],
            LENGTHUNIT["unknown",1]]]
Data axis to CRS axis mapping: 1,2
Origin = (426600.000000000000000,6718000.000000000000000)
Pixel Size = (0.050000000000000,-0.050000000000000)
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  426600.000, 6718000.000)
Lower Left  (  426600.000, 6717800.000)
Upper Right (  426800.000, 6718000.000)
Lower Right (  426800.000, 6717800.000)
Center      (  426700.000, 6717900.000)
Band 1 Block=1024x1024 Type=Byte, ColorInterp=Red
  Overviews: 2000x2000, 1000x1000, 500x500, 250x250, 125x125
  Overviews: arbitrary
  Image Structure Metadata:
    COMPRESSION=JPEG2000
Band 2 Block=1024x1024 Type=Byte, ColorInterp=Green
  Overviews: 2000x2000, 1000x1000, 500x500, 250x250, 125x125
  Overviews: arbitrary
  Image Structure Metadata:
    COMPRESSION=JPEG2000
Band 3 Block=1024x1024 Type=Byte, ColorInterp=Blue
  Overviews: 2000x2000, 1000x1000, 500x500, 250x250, 125x125
  Overviews: arbitrary
  Image Structure Metadata:
    COMPRESSION=JPEG2000


texts:
I have some old styles in CartoCSS and some I have found online.

However obviously with the update of mapbox studio it uses Mapbox GL styling and the two are different. I can't see a way of importing CartoCSS into mapbox studio.

I have done a little research and have found some CartoCSS to JSON converters. But I'd like to understand the best way of doing this to minimise any transalation errors in the process. Ideally if anyone has tried and tested any methods it would be really useful to underatand the pros and cons related to each method.


texts: Converting shapefile data to .osm using ogr2osm

texts:
I've used ogr2osm command line tool to convert shapefile to .osm file while doing some editings in QGIS. The problem is after this convert, the updated OSM includes no feature and the attribute table is empty too. But using JOSM I can see data and attribute table. What is wrong with the OSM data? Is it possible that 'geometry' column has been deleted during the converting process or maybe'topology' missing?

python ogr2osm.py city_lines.shp

Also, the volume of the changed data decreases to 70MB from 2GB too!


texts:
What is os.sep and when should i use os.sep while scripting for arcgis ?

For example in below code i don't understand why should i use os.sep .

import arcpy
from arcpy import env
import os

# Set the workspace for the ListFeatureClass function
#
env.workspace = "c:/base"

# Use the ListFeatureClasses function to return a list of
#  all shapefiles.
#
fcList = arcpy.ListFeatureClasses()

# Copy shapefiles to a file geodatabase
#
for fc in fcList:
  arcpy.Copy_management(fc, "d:/base/output.gdb" + os.sep + fc.rstrip(".shp"))


texts: Saving attributes information (features) in QGIS layer

texts:
I have a road network (lines) and points (Address). I am using PyQGIS to join points to the nearest lines using the closestSegmentWithContext functionin QGIS.  However, the attribute table of generated layer (myLayer) is empty as shown here. Is there a way to save all features(fields) of joining points like unique IDs, lengths of joining points, etc in the attribute table of vector layer?
I searched about FileWriter in QGIS, but it didn't solve my purpose, or I might not apply correctly.
The PyQGIS code for joining line segements to nearest points is given below and shape files are available here:
roadlyr = QgsProject.instance().mapLayersByName('TR_ROAD')[0]
addrlyr = QgsProject.instance().mapLayersByName('ADDRESS')[0]

#List all features
adresses = [f for f in addrlyr.getFeatures()]
roads = [f for f in roadlyr.getFeatures()]

#Create vector layer
vl = QgsVectorLayer("LineString?crs={}&index=yes".format(roadlyr.crs().authid()), "myLayer", "memory")
provider = vl.dataProvider()

for adress in adresses:
    a = min([road.geometry().closestSegmentWithContext(adress.geometry().asPoint()) for road in roads], key=lambda x: x[0]) #For each road find closest address
    gLine = QgsGeometry.fromPolyline([QgsPoint(adress.geometry().asPoint()), QgsPoint(a[1])])
    f = QgsFeature()
    f.setGeometry(gLine)
    provider.addFeature(f)


texts: "RuntimeError: An expected Field was not found or could not be retrieved properly. [temp]" while using SearchCursor

texts:
I was trying to convert a .csv table to a geodatabase table and then write some rows that meet some conditions (using sql statement) from the table into a txt file. see the code below.
file_path = r'C:\Users\Documents\work\project\2011.csv'
gdb = r'C:\Users\Documents\work\project\GPS.gdb'
outfile = r'C:\Users\Documents\work\project\result.txt'

arcpy.env.overwriteOutput = True

arcpy.env.workspace = gdb
table = arcpy.TableToTable_conversion(file_path, gdb,'temp')
# add the columns
# replace space with _
# only use first ten characters because
print([f.name for f in arcpy.ListFields(table)])

newfile = open(outfile, 'w')
sql = '{0} = {1}'.format(arcpy.AddFieldDelimiters(table, 'Domestic'),'true')

fields = ['Case_Number', 'Block', 'Ward']
with arcpy.da.SearchCursor(table, fields, sql) as scursor:
    # write each row into file
    for row in scursor:
        newfile.writeline(row.join(','))

newfile.close()

Then I'm getting this error after printing the field names;
[u'OBJECTID', u'Case_Number', u'ID', u'Date', u'Block', u'IUCR', u'Primary_Type', u'Description', u'Location_Description', u'Arrest', u'Domestic', u'Beat', u'Ward', u'FBI_Code', u'X_Coordinate', u'Y_Coordinate', u'Year', u'Latitude', u'Longitude', u'Location']

Traceback (most recent call last):
  File "C:\Users\AHMAD\Documents\work\Help_file\h.py", line 23, in <module>
    for row in scursor:
RuntimeError: An expected Field was not found or could not be retrieved properly. [temp]


texts: Rotating Point Symbols in ArcGIS Javascript API 4.5 SceneLayer

texts:
I am using a SceneView and SceneLayer with the ArcGIS Javascript API 4.5. My SceneLayer has point features and I want to display them as cones with the point of the cone pointing to the ground. I can get them to render as cones with this renderer:

var renderer = {
    type: 'simple',  // autocasts as new SimpleRenderer()
    symbol: {  // symbol type required for rendering point geometries
        type: 'point-3d',  // autocasts as new PointSymbol3D()
        symbolLayers: [{  // renders points as volumetric objects
            type: 'object',  // autocasts as new ObjectSymbol3DLayer()
            resource: { primitive: 'cone' },  // renders points as cones
            width: 15
        }]
    }
};

However the cones are pointing the wrong direction and I can't find a good example of how to rotate them. Does anyone have any examples of this?

I would also like these points to scale based on zoom. I know that scale-based symbol sizing can be done for a map view but I haven't found how to do this with a scene view. Is this possible?


texts: I have a tif image file, and a .tfw world file (created from OSM data with Mapertive). How can I (using linux command line) convert that to a GeoTIFF file? (i.e. I want to have one file, not 2). I'm sure it's possible with gdal or something.


texts: How to delete boundary lines of split shapefile tiles with SQL of Virtual Layer

texts:
I have the split shapefiles like same size tiles.
I want to show these merged on QGIS.

So, I tried to use Virtual Layer like following image.

And, I wrote following SQL:

select * from north
UNION
select * from central
UNION
select * from west

But, the boundary line of shapefile shown.
I want this,

In this case, how do I write SQL?


texts: Setting print layout to portrait using QGIS 3?

texts:
I can't get the print layout to appear in portrait.  It opens in landscape and Layout/Page Setup... allows for portrait, but the layout canvas remains in landscape.

In 2.18 the "Composition" Panel has "Page Size" as its first item, with a drop down Landscape/Portrait control box.

In 3.0.0, the "Layout" Panel does not have this, and I can't find it in the "Item Properties" panel.

Is there somewhere that I can set it to portrait?


texts: Draw arrow on the line with Geoserver and Mongodb data

texts:
I'm looking for the guide to draw the arrow at end of line in geoserver.

So follow this thread (How do I draw the arrow on the line using SLD of Geoserver?), I've made it work with the shapefile.

However, with my data source is from Mongodb, the arrow did not appear.
Here the sample of my Mongodb record.

{
"_id" : "Y6z5zsA6RF8Wpoocu",
"name" : "-1",
"description" : "",
"geometry" : {
    "type" : "LineString",
    "coordinates" : [
        [
            103.0102419455,
            21.378932367
        ],
        [
            103.0102432625,
            21.3789060899
        ],
        [
            103.0102144437,
            21.3788595105
        ]
    ]
    },
}

If I choose generic style, the layer preview display ok. But when I change to the arrow style, the layer preview not work at all. So I added the
    "properties" : {
        "the_geom" : ""
    },
    "the_geom" : ""
to make sure this part work, then the line appear again but without the arrow

<ogc:Function name="endPoint">
<ogc:PropertyName>the_geom</ogc:PropertyName>
</ogc:Function>

It's seem that the < ogc:Function name="endPoint" > is not work with MongoDB source. When I remove that part the arrow appear but in the middle of the line.

How should I config with my data?


texts: For Spatialite databases in QGIS, why is the provider 'spatialite' sometimes and 'ogr' other times?

texts:
I have many spatialite databases that I use across a lot of projects and sometimes the Provider is set to 'spatialite' and sometimes it's set to 'ogr', seemingly arbitrarily.

This causes issues when updating datasources for broken links etc.

Why does this happen and is there a way to force it to be consistent?


texts: How to change the layer names in WMS served from ArcGIS Server 10.0?

texts:
I have published a number of wms layers with AGS 10.0. Although I have named the layers logically in the mxd nad named the wms service accordingly, the wms GetCapabilities document still names the layer 0,1,2,3 etc. There is no way to change these names in AGS Manager. I have tried to name them differently in the GetCapabilities Doc but this creates problems when trying to display the layer because AGS can´t reference the layers.

Is there any way that I have missed in order to name the layers differently?


texts: Disappearing tiles depending on the zoom

texts:
I'm working on a CentOS 6.8 tiles server hosted in a VM and I observed some disappearing tiles depending on my zoom level in QGIS 2.16, I don't know where it comes from...
Here are some pictures of my screen on which I'll progressively zoom in :

I get the same result on some others countries while others works perfectly...
I'm using QuickMapServices with TMS protocol.


texts: Where can I get data about dog park areas in cities around the world? I wanted to use Overpass API but couldn't find the amenity key for it


texts: QGIS 3.4.4 crashing when adding hyperlink into the Attribute Table

texts:
I made a CSV with coordinates and hyperlink connected to JPG photo.
I uploaded it into QGIS, export it as  ESRI shapefile, and uploaded back it into QGIS.

I want to display the photo with hyperlink. I set the layer Attributes From properties as follow: Widget Type: Attachment, Storage Mode: File paths, Display button to open file dialog marked, Use hyperlink for document (read-only) marked and Integrated Document Viewer Type: Image.

When I use the "Identified features" button I see the hyperlink, when I click it the JPEG is opened with Dropbox.

However when I am trying to add anther hyperlink to the shapefile from the Attribute Table  , the QGIS is crashing (the log at the end).

So, I have two questions:

1) How can I prevent QGIS crushing when adding hyperlink to the Attribute Table?

2) How to set the layer to display the photo, not the hyperlink?

Log:

2019-02-15T14:52:01     WARNING    warning:C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\urllib3\connectionpool.py:857: InsecureRequestWarning:

             Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

             traceback: File "", line 1, in
              File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python\qgis\utils.py", line 344, in startPlugin
              plugins[packageName].initGui()
              File "C:/Users/nitza/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\quick_map_services.py", line 121, in initGui
              self.init_server_panel()
              File "C:/Users/nitza/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\quick_map_services.py", line 311, in init_server_panel
              self.server_toolbox = QmsServiceToolbox(self.iface)
              File "C:/Users/nitza/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\qms_service_toolbox.py", line 155, in __init__
              self.show_news()
              File "C:/Users/nitza/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\qms_service_toolbox.py", line 160, in show_news
              qms_news = client.get_news()
              File "C:/Users/nitza/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\qms_external_api_python\api\api_abstract.py", line 64, in get_news
              response = get(url, verify=False)
              File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\requests\api.py", line 72, in get
              return request('get', url, params=params, **kwargs)
              File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\requests\api.py", line 58, in request
              return session.request(method=method, url=url, **kwargs)
              File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\requests\sessions.py", line 512, in request
              resp = self.send(prep, **send_kwargs)
              File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\requests\sessions.py", line 622, in send
              r = adapter.send(request, **kwargs)
              File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\requests\adapters.py", line 445, in send
              timeout=timeout
              File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
              chunked=chunked)
              File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request
              self._validate_conn(conn)
              File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\urllib3\connectionpool.py", line 857, in _validate_conn
              InsecureRequestWarning)


texts: Join .csv file and .shp of georeferenced points

texts:
I have georeferenced a map and saved a selection of some points on the map. These points are cities of departure and arrival and I want to join the .shp with a and excel .csv with the information of the migration of my individuals to represent their way.

-If I join on my .shp (the selected points and the origin cities on .csv) I only get 15 out of 40 lines as many individuals started their trip from the same city

-If I joint on my .csv I have a complete table attributes. I save a selection and want to open it as .shp but I only have three extensions (.dbf, .prj, .qpj)

How can I get a complete joint table attributes between a .cvs of 40 items and a .shp of 15 items and make sure the items are georeferenced on my map?

I hope this makes sense, I'm still a beginner ;)

Thank you for your help


texts: how to build a routeable network for pgRouting with srid 3785

texts:
I'm following the pgrouting-workshop http://workshop.pgrouting.org/chapters/topology.html and It works, but in my project I'm working with the mercator projection(srid 3785) and there is not a routed network like the Open Street Map to work in, so I need to build my own.. so for testing purposes with the help of google maps and Proj4js I build a simple graph like this

point1 = "POINT (-7363703.972517611 -1966750.4952863816)"
point2 = "POINT (-7363530.794875402 -1966719.4427436402)"
point3 = "POINT (-7363414.945004408 -1966694.3618437336)"
point4 = "POINT (-7363365.977533163 -1966681.2242294976)"
point5 = "POINT (-7363419.722318676 -1966658.5319867264)"
point6 = "POINT (-7363344.479618957 -1966793.4911147922)"
// it's in lon / lat format

Then the geom column in ways table
way_red =   "MULTILINESTRING((point1, point2, point3, point4))"
way_green = "MULTILINESTRING((point3, point5))"
way_blue =  "MULTILINESTRING((point4, point6))"

Questions:

Is it correct the format I builded the ways ??
Exist a correct or pre-established format to  construct a routeable network?
the workshop uses "MULTILINESTRING", is it ok if I use just "LINESTRING"??

Thanks in advance, and sorry for my english.


texts: what's the difference between spectral signature and features in remote sensing?

texts: I would like to understand if is there any difference or relation between spectral signature concept and features in remote sensing?


texts: by viewing two bands in erdas imagine the grey levels of the water differ.  on the one image as below the water is dark and the other image the water is light.  why is that?  what cause the difference? thanks


texts: Using a dropdown to change the fill-color of a single feature

texts:
I have a geojson layer I am bringing into my Mapbox app:
var states = {
 "type":"FeatureCollection",
 "features": [
 {"type":"Feature","id":"01","properties": {"name":"Alabama","density":94.65},"geometry":{"type":"Polygon","coordinates":[[[-87.359296,35.00118], ....,[-87.359296,35.00118]]]}},
 {"type":"Feature","id":"02","properties":{"name":"Alaska","density":1.264},"geometry":{"type":"MultiPolygon","coordinates"....
 ...
 {"type":"Feature","id":"72","properties":{"name":"Puerto Rico","density":1082 },"geometry": {"type":"Polygon","coordinates":[[[-66.448338,17.984326],....,[-66.448338,17.984326]]]}}
 ]
}

map.on('load', function() {
    //https://eric.clst.org/assets/wiki/uploads/Stuff/gz_2010_us_outline_500k.json
    map.addSource("us-states", {
            "type": "geojson",
            "data": states
    });

    map.addLayer({
       'id': 'us-states',
        'type': 'fill',
        'source': 'us-states',
        'filter': ['==', '$type', 'Polygon'],
        'paint': {
          'fill-color': '#fd8d3c'
          'fill-opacity': 0.8,
          'fill-outline-color': '#000'
        }
   });

This layer is essentially just state boundaries with 2 key attributes, an 'id' - which is essentially the state fips code, and the 'name' - which is just the state name. I also have a dropdown that has the state names.
<select id="state_filter" name="state_filter"> <!--  onchange="stateSelector()" -->
<option value="Alaska">Alaska</option>
<option value="Arizona">Arizona</option>
  ...
</select>

I have a listener to handle on change events. What I am trying to do, is choose a state, and use that state name to match to a feature.properties.name and change the fill-color of that state feature only. Below applies the color to the entire layer:
 var dropdown = document.getElementById('state_filter');
 var my_state = "";
 dropdown.addEventListener('change', function (e) {
       my_state = e.target.value;
       var stateName = states.features[0].properties.name;
       map.setPaintProperty(
       'us-states',  // Need to apply the feature for the state that matches my_state here
       'fill-color',
       "#2c7fb8"
       );
 });

It seems I need to use an expression with an ID or the name attribute somehow, but I am not sure exactly how to do that. Any suggestions on how to get this to work?


texts: Why do CMYK colours in ArcMap not match those in Adobe products?

texts:
I'm creating a map in ArcMap, based on a style guide which specifies colours in CMYK notation. So I've set the colours in ArcMap's color selector. The layer has no transparency set, and is the only layer drawn.

Why does the polygon below not match the colours of the equivalent object when viewed in the PDF style guide?

(ArcMap on the left, the PDF on the right. Note the CMYK numbers match, but the colours clearly don't)

When I examine the ArcMap colour in PhotoShop's colour picker, it shows as C:75 M:51 Y:55 K:29

Is there a setting somewhere which tells ArcMap which colour profile to use? (I'm out of my depth here as I don't fully understand this colour space stuff.....)


texts: Why are Low Values showing as hot spots?

texts:
Im running hotspot analysis on point data, attempting to examine pollution emissions. I ran spatial autocorrelation first in order to determine the default distance threshold to use in the fixed distance band option of the hotspot tool, as well as to determine on a global scale if there was a clustering pattern.

I used these options in hotspot: Fixed distance band, Euclidean distance and row standardized my data. When I look at the results, I observed a hotspot where 10 of the 13 hotspot points have a value of 0 in emissions (the other 3 points are high values). Shouldnt these have displayed as cold spots?

I believe this is caused by the fixed distance I used, and I am sure if I decrease this number it will correct itself, but I thought that using the derived distance was best practise(?).


texts: Converting *.xlsx to shapefile in ArcGIS for Desktop?

texts:
I'm trying to import an xlsx file into ArcGIS (10.2.1, everything is fully licensed and activated), and convert it to a shapefile for further analysis.

The xlsx file is ~180mb, and contains just under 600,000 records.

I can add the xlsx file into ArcGIS. This generates the appropriate table correctly.
I can create events from the x and y coordinates. This displays the data on the map correctly.

But...

When I go to convert the events to a shapefile by exporting the data, everything fails on me. For some reason when it exports the events, it totally ruins the table (skips columns, misreads fields, ends up with data all over the place, etc.).

I can't see how it is a memory issue, as the computer has dealt with much larger pre-existing shapefiles before that have over 2 million points in. It just seems to be an issue with the export process. ArcGIS does not display any error message, it says it's completed the export process without any issues and asks if I would like to add the new file to the map. There is nothing to indicate that there's a problem until I go to open the table for the new shapefile it supposedly generated.

I've tried converting the xlsx file to csv, and run into the same issue. I can open the csv, generate the events to display the x,y data, but when I go to export the events to an actual shapefile, it destroys the table.

Any ideas? Is there an alternative way to generate the shapefile?


texts: Extracting street segments from google maps?

texts:
I'm using the google maps v3 api and am trying to extract a list of intersections and street segments from an overlay created from a KML file.

Ideally, I'd like to be able to get the poly lines in a manner similar to the way Google Mapmaker works currently when you right click and go to 'find near this point'(http://www.google.com/mapmaker?hl=en)

How can this be accomplished?


texts: Summary statistics over LARGE region in Google Earth Engine

texts:
I am grappling with an issue in reducing NDVI values for South America. I am interested in knowing what the mean NDVI is for this continent (single value), without having to lose resolution by increasing my pixel scale to a very large number.
My thought was trying to place some type of grid that could create smaller regions and then make a dictionary and take the mean of the means from the grid. I'm not sure if my logic is totally sound here, but I'm hoping I'm on an okay track.
Would GEE be able to do this, and if so, is there a way to create a function to simplify this task?
This code doesn't work for obvious reasons... system time out and memory limits.
var sam_mean = fit_year_ndvi.clip(sam).reduceRegion({
  reducer: ee.Reducer.mean(),
  geometry: sam,
  scale: 1000,
  maxPixels: 1e12
});

Here is my link:  https://code.earthengine.google.com/b8486d4ef347cde7555614254b143ec7
Here is my asset link: https://code.earthengine.google.com/?asset=users/anna_odell/continents


texts: Extract feature for automation method using ERDAS Imagine 2013 software?

texts:
I have Quickbird Satellite data, hence I want to extraction from Building foot prints using automation method.

Could you give whether its possible or not using ERDAS Imagine 2013?


texts: I'm using QGIS 3.4.9. When I try to create a heatmap the only radius option is degrees. Can you tell me how to change this to meters?


texts: Looking for best practices for GIS file systems

texts:
Possible Duplicate:
  Organization and tidiness issues - How do you deal with multiple copies of layers?

I'm trying to organize my GIS data in a file system.
I work with DTED (0,1,2), raster images (geotiff, jpeg..), shapefiles, DEM.
I have to define a file system with a list of directories and a file name conventions.
The solution must be simple and clear.

Is there a standard?


texts: How do I get the distances to every cell in GRASS?

texts:
I have an elevation raster map, a point, a raster map defining the viewshed from that point, and now I want to produce another raster map with the results of a function of the distance between the point and every point (cell) in the elevation map that has a defined value (not equal to 180) in the viewshed raster map. The function the distance that I want to compute between the point and the cells in the elevation map is the inverse square law.

How do I do that using GRASS?


texts: Why is the Globe plugin missing in QGIS 2.17.0 master?

texts: It seems that the 'Globe' plugin is missing in QGIS 2.17.0 master. Is this a bug or is there something I'm doing wrong:


texts: Dynamically style geoserver layer with timestamp column --> age of entry

texts:
I have a a postgis table with point geometries and a timestamp column, which has the information when the point was created. This table is already loaded as a layer into geoserver.

So now in Geoserver, I would like to style this layer via SLD, so that the color of the point changes by its age, i.e. the difference between the point's timestamp and the server time.

Lets say red for older than 2 years, yellow for older than 1 year, green for younger than 1 year.

Is there an approach via sld , maybe by using an environment varialble that can solve this requirement?


texts: ArcGIS and QGIS compatibility: issues with Shapefiles or Geodatabases?

texts: I work at a small planning commission as 1 of 2 GIS people, where we have 2 ArcGIS licenses.  A volunteer recently starting working with us.  He is using QGIS and mostly editing shapefiles.  I probably should have considered this question first.... Do ArcGIS and QGIS play nicely together?  Ultimately everything will end up in ArcGIS, will there be any issues editing shapefiles or geodatabases in QGIS and then opening and/or editing them in ArcGIS?  I don't know if I am pushing it here asking another question... If map annotation is edited in QGIS, can that map be opened in ArcGIS?


texts: Creating Zip Code-Level Choropleth Using Leaflet.JS?

texts:
I am new to Leaflet.js.

Is it possible to create a choropleth using zip-code level data?

I've seen plenty of choropleth examples using state-level data and even a few using county-level data.

If so, what would be a good way to go about it using Leaflet?

Do I need to obtain coordinates for the shapes of each zip code I'm interested in visualizing?


texts: Turning on metadata geoprocessing history for feature class after export/copy from in_memory workspace?

texts:
I usually run a series of geoprocessing tools by using in_memory workspace before saving a clean version of my feature classes. Most of the time geoprocessing history related to this final copy has no importance. However the project that I am currently working on requires me to keep geoprocessing history but somehow in_memory does not keep this information.

The snapshot of the metadata section is as follows:

I have found this ArcGIS Idea to Allow IN_MEMORY datasets to store metadata generated by geo-processing tools, which talks about exactly the same problem, but was wondering if anyone has got any workaround to this problem?


texts: Extraction of Digital Terrain Model Intersections

texts:
I have two digital terrain models in ESRI ASCII (.asc) format. Their elevations intersect in multiple places. How can I extract the intersection of these two DTMs as a polyline or polygon shapefile?

Example: I'm after the dotted line in this figure as a polyline.


texts: Get the LatLon of middle points of a road segment?

texts:
Suppose I have the LatLon of the two end points as well as a small number of middle points of a road segment.

What is the best way to calculate the LatLon of a middle point P of the road segment given the road distance between P and one end point of the road segment?


texts: Is there a way to change symbology with time in ArcGIS Desktop or Portal?

texts:
I have a time-enabled layer that I am interacting with through Arc's time slider. Now, I'd like to change symbology with time. More specifically, I want my features to change color with every year.

Is there a way to do this in Desktop or Portal? If so, how?

I'm not looking for answers that suggest creating new features for each year. Before I do something like that, I want to be sure the functionality doesn't already exist somewhere.


texts: pgrouting Dijkstra: routing with non-vertex data

texts:
I have some data samples, they are some traffic accident locations (have shape files) I really want to use the dijkstra function of pgrouting to look into their shortest distances between each other. However, I noticed that dijkstra requires all the points need to be the vertices of a topology. But obviously my data points are not the vertices of the road network.

Is there any way to integrate my data points to the road network and make them vertices too?

What is the good approach to route non-vertex data like this?


texts: Software to detect intersections (within a tolerance) between 3d polylines

texts:
Is there any way to detect intersections (within a tolerance) for a 3d set of polylines?

ArcGIS Topology Check seems to project everything into 2d (x-y plane) before checking, so shows a lot of false positives.

Autocad Map 3d Drawing Cleanup suffers from the same problem.


texts: Intersecting lines to get crossings using Python with QGIS?

texts:
I have a set of lines representing bus lines. Some of the lines are overlapping and take the same roads.

I am able to extract the nodes.

However I am interested in extracting only crossings like this:

How can I do this? I am looking for ways with QGIS or Python.
I tried the intersection method from GDAL Python but this basically returns me only the vertices.
The Line Intersections method from QGIS returns me the crossings if two lines cross. However in the case that two bus lines go far part of their route on the same road, it doesn't give me they point where they merge.


texts: Seeking tutorials about GIS workflows in FME?

texts:
I have never used FME for spatial processes before. However, I would like to use it in automating some GIS processes and learn.

Are there are any specific tutorials that explain this?


texts:
I have commune level map in shapefile and CSV.
Originally, I have shapefile, exported it to CSV, then to STATA for data manipulation.  Then I have exported it as CSV to import to QGIS as polygon.
I wanted to find WKT in the CSV file, but it is not straight-forward as x and y coordinates as in point data.
Please help me import the CSV into QGIS as polygon.
https://data.opendevelopmentmekong.net/dataset/c70a9555-2918-4455-a144-9716a96fc3da/resource/939608e9-4b1f-404b-8174-f0d6be609ecb/download/shp_census_2008.zip
https://data.opendevelopmentmekong.net/dataset/c70a9555-2918-4455-a144-9716a96fc3da/resource/4b99aba0-ce2d-4790-8d74-8fb30f83f5b7/download/csv_census_2008.zip


texts: How are ice, snow, and clouds differentiated in data from remote sensing instruments?

texts: This was from a Science Olympiad remote sensing test. I know that each will reflect different wavelengths of light and that there's also a lot of overlap...I just don't really know what the exact (or approximate) differences are.


texts: Creating Custom Vector Basemap with ArcGIS API for JavaScript

texts:
I am using the ArcGIS API for JavaScript 3.x and would like to add a vector tile layer that I created to my map as a basemap that appears in the basemap gallery dijit. I am able to load my layer into the map as a VectorTileLayer but when I try to add the layer to the basemaps it just doesn't seem to work.

How can I do this?

I've tried creating a basemap object with the url set to my VectorTileServer, creating a BasemapLayer with a VectorTileLayer type, and use creating a map without a basemap and adding the VectorTileLayer as a layer. The last try got my closest and looks like this:

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
  <title>Vector Basemap Test</title>
  <link rel="stylesheet" href="https://js.arcgis.com/3.31/dijit/themes/claro/claro.css">
  <link rel="stylesheet" href="https://js.arcgis.com/3.31/esri/css/esri.css">

However, the layer doesn't show in my basemap gallery and the other ways of doing it are closer to the few examples I can find online.

You can see my other tries here: https://codepen.io/sirhcybe/pen/abOoqmq


texts: Google Earth Engine - WFS, WMS, and KML feeds

texts:
I'm new to Google Earth Engine, but I am trying to determine if there is a way to produce WFS, WMS, or KML feeds with it. For KML it can't just be the file, but a web service that has a URL.

The end goal is to have a URL that I could have read into another database, but at the moment that database can only take in feeds (no static files). I could also import GeoRSS and GeoJSON feeds, if there is a solution for that within GEE.


texts: How to dynamically load Google Maps markers around center coordinates?

texts:
I have to implement Google Maps in website that would display a lot of markers globally. A good comparison would be geocaching.com (with exception that I wouldn't have that many markers).

Let's say that database consists of 100 000 markers. It would be insane to request for all of those markers as user would see only small part of them. When I observe sites like geocaching.com markers are displayed only around centre of map and more are added when when user drags maps away. In this way response does not take long and there is no overkill for clients device to display relatively small amount of markers.

The easiest way to accomplish this would be to send centre coordinates of map to server and use haversine formula to calculate bounding square coordinates for some distance, query the database (it shouldn't be to expensive with correct indexes on lat, lng fields) and send that to server. Then in client side add event listener on drag and zoom to catch when bounds of map window is outside from area where markers are and request new markers. However this is not very efficient.

My idea of more efficient way goes like this:

Divide whole map in equal squares(or at least in sectors) that could be identified by unique index. Below is rough visualizer for this.

I could detect in which section user currently is (by checking map centre coordinates) and make AJAX call asking for markers in this section. Benefit would be that response could be cached (I am going with Varnish). Great thing about this is that when Europe sleeps and USA is awake most of USE section are cached, and vice versa.

After first batch of markers is received send 8 more request for section next to this. Below again is rough visualizer.

Set min zoom level so that user couldn't zoom out of all 9 section area. The idea behind this is that I don't want client device to handle to many markers so there will always be only markers that are in corresponding 9 sections. If user would want to navigate for example from USA to Belgium he would have to use geolocation input.
Catch whenever the bounds of map window goes outside of 9 section and request for new markers. In this example map centre was in section#5 but now it is in section#4. I request there more section, add those markers to map and remove markers from sections #3, #6 and #9.

I am not 100% sure about this design, especially about how to divide whole earth in section? Earth in spherical, map is 2D plane. Should I divide by lat, lng coords or use haversine?

I looked more into how Google Maps transfer spherical globe to plane and found this great example. It can be observed that the longitude lines are actually parallel so I could introduce a constant step for longitude.

Lets say we are aiming for section square to be 5x5 km. Made simple calculation with length of equator 40 075 km and got that for 5km we should use longitude step approx. 0.045

deltaLon = (360/P)*d, where:
deltaLon = step for longitude in degrees
P - length of equator in km
d - size if section square we are aiming in km

Knowing the step we can easily calculate number of section in longitudinal directions and get longitudinal index from given longitude coordinate. This index can be sent to server where we would create to longitude bounds and run MySQL query WHERE longitude>min_bound AND longitude<=max_bound

The problem is with latitude. In example provided above it can be observed that a change of one degree in latitude have bigger impact on change in km on map when moving further away from equator.

My question is what would be the mathematical expression for latitude step if we are aiming for section square size of d? (I don't care about poles, for all I care we can simply forbid to add markers near to poles and start counting our latitude index from lets say +/-80 degrees)


texts: Is there a keyboard shortcut to draw a perftectly straight line?

texts: In most programs, when you have a line tool, you can hold control or shift and it will let you draw a perfectly vertical or horizontal line, sometimes it the tool will snap at 90 degree angles. How would I go about doing this in QGIS?


texts: Calculation of mean and standard deviation of raster images in R

texts:
I have a set of raster images (GeoTIFF, Landsat 1984-2018) which I cropped with my AOI using a shapefile.
Now I want to stack them and calculate the mean and standard deviation of every pixel of the stacked images (in space and time). How can I stack them and calculate the mean and standard deviation? For the outputfile I need one image for the mean and one for the standard deviation.
library(raster)
library(rgdal)

#load data

setwd("C:/Users/cathe/Documents/GEOTIFF_offsetcorrected")
dbase = "C:/Users/cathe/Documents/GEOTIFF_offsetcorrected"

#polygon with crop-extend

shape_data <- readOGR("C:/Users/cathe/OneDrive/Documents/ArcGIS/Projects/Cologne/WGS_1984_UTM_Zone_32N/Cologne.shp", stringsAsFactors=FALSE)

#load tif files

ALL_FILES <- list.files(path = dbase, pattern = "*\\.tif$|*.TIF$")

#output

outfiles = file.path("C:/Users/cathe/Documents/Output",
                     paste0(basename(tools::file_path_sans_ext(ALL_FILES)),
                            ".tif"))
#crop

for (i in seq_along(ALL_FILES)) {
     r = crop(stack(ALL_FILES[i]), shape_data)
     writeRaster(r, filename=outfiles[i],
              bylayer=FALSE,
              format="GTiff",
              datatype= "INT1U",
              options="COMPRESS=ZIP",
              overwrite=TRUE)
}

mean <- mean(r)

plot(mean)

writeRaster(x = mean, filename = "mean1.tif", driver = "GeoTiff", overwrite=TRUE)

I get a result, but I am not sure if it is correct?


texts: Getting Top 10 percent of value for a specific field in QGIS

texts:
I am trying to filter one data field for the top ten percent of values in that field. Something like:
SELECT TOP(10)PERCENT IN "TUNGSTEN"

However, my database through QGIS does not seem to support SELECT TOP and I am new to these expressions and may be way off.
This artile, https://www.w3schools.com/sql/sql_ref_top.asp, states that :
Note: Not all database systems support SELECT TOP. MySQL uses LIMIT, and Oracle uses ROWNUM.
I'm guessing I may have the wrong code for the database system but I can't make the other options work yet.
Can you give me some direction?


texts: Displaying ArcScene polygon extrusion edges?

texts:
When I extrude polygons in ArcScene 10.0, the polygon outlines are not displayed regardless of the symbol outline width/color.  Thus the extruded edges are not shown.  Here's a screenshot showing the problem with USA states. I need to outline each state at the top of it's extrusion.

How do I do this?


texts: Create raster layer from points with PostGIS

texts: I'm pretty new to this part of GIS; I have a layer of points that represent cell phone towers; with a given distance to simulate coverage, how can I transform that represented coverage into a raster? like this:


texts:
Right now, I start using Interlis in QGIS (I never used Interlis before...). However, there seems to be a systematical encoding problem. When I select the transfer file and start the import, the following error message appears:

 UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4'
 in position 40: ordinal not in range(128)

What do I need to change (step by step)?


texts:
The objective of the following code is to pan the main map to the definition queried point and then zoom or pan the vicinity map to the county the point is contained in. I have working code for other figures that do not have vicinity maps. Here is that code below.

aprx = arcpy.mp.ArcGISProject(r"C:\Users\neuce\Documents\Projects\HouseMapping\ArcGIS\Figure 02.aprx")
m = aprx.listMaps()[0]
lyt = aprx.listLayouts()[0]
mf = lyt.listElements('MAPFRAME_ELEMENT')[0]
with arcpy.da.SearchCursor(tempSites, fields) as cursor:
    for row in cursor:
        for lyr in m.listLayers():
            if lyr.name == "Site":
                lyr.definitionQuery = "Match_addr = '{0}'".format(row[0])
                print("DQ applied "+ row[0])
                mf.panToExtent(mf.getLayerExtent(lyr))
                for txt in lyt.listElements('TEXT_ELEMENT'):
                    if txt.name == "Address":
                        txt.text = "{0} \n {1}, {2} {3}".format(row[2],row[4],row[3],row[5])
                print("panned")
                aprx.save()
                print("Saved")
                lyt.exportToPDF(r"C:\Users\neuce\Documents\Projects\HouseMapping\Figure 2 - {0}.pdf".format(row[0]))
                print("exported")

del aprx

But when I try and work with multiple mapframes I start getting the following error.

Traceback (most recent call last):
  File "C:\Users\neuce\Documents\Projects\HouseMapping\Base Script.py", line 35, in <module>
    mf.panToExtent(mf.getLayerExtent(lyr))
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\_mp.py", line 1396, in getLayerExtent
    return convertArcObjectToPythonObject(self._arc_object.getLayerExtent(*gp_fixargs((layer, selection_only, symbolized_extent), True)))
ValueError: <MappingLayerObject object at 0x000001BFD2450D30>

Here is my current code:

aprx = arcpy.mp.ArcGISProject(r"C:\Users\neuce\Documents\Projects\HouseMapping\ArcGIS\Figure 01test.aprx")
with arcpy.da.SearchCursor(tempSites, fields) as cursor:
    for row in cursor:
        m = aprx.listMaps()[0]
        lyt = aprx.listLayouts()[0]
        mf = lyt.listElements('MAPFRAME_ELEMENT')[0]
        for lyr in m.listLayers():
            if lyr.name == "Site":
                lyr.definitionQuery = "Match_addr = '{0}'".format(row[0])
                print("DQ applied "+ row[0])
                mf.panToExtent(mf.getLayerExtent(lyr))
                for txt in lyt.listElements('TEXT_ELEMENT'):
                    if txt.name == "Address":
                        txt.text = "{0} \n {1}, {2} {3}".format(row[2],row[4],row[3],row[5])
                print("panned")
                aprx.save()
                print("Saved")
        m = aprx.listMaps()[1]
        lyt = aprx.listLayouts()[1]
        mf = lyt.listElements('MAPFRAME_ELEMENT')[1]
        for lyr in m.listLayers():
            if lyr.name == 'CentralCoastalCounties':
                lyr.definitionQuery = "CNTY_NM = '{0}'".format(row[1])
                print("county DQ applied")
                mf.camera.setExtent(mf.getLayerExtent(lyr))
                lyr.definitionQuery = ""
                print("County DQ removed")
                aprx.save()
                lyt.exportToPDF(r"C:\Users\neuce\Documents\Projects\HouseMapping\Figure 1 - {0}.pdf".format(row[0]))
                print("exported")

del aprx

I think the value error means that the layer object doesn't contain something it should but i don't know what it needs.


texts:
declutter does not working as it should be for point geometry, it should avoid overlapping labels and not styling format or geometry. when I set it true for points, points are starting disappear when map is zoomed out.

I used the example from OpenLayers then I set declutter to true for point (line 190) and also for line (line 168), for line is working and it avoid labels to overlap and it allows line geometry overlapping each other with the custom styling, but the whole point will be disappear when the map is zoomed out.

Did I miss any configuration or this is a bug from OL. (Tested with OL 6.1.1 and 6.2.1) at the end the question is why the points geometry disappear with enabled declutter?

Code Snippet: https://codesandbox.io/s/vector-labels-s7oeu


texts: What is the best method to publish a large amount of data on ArcGIS Server?

texts:
I am publishing 2 million records using ArcGIS Server. We are using ArcGIS for Desktop 10.1 and ArcGIS for Server 10.1.

We have district wise data for India (like State----District etc) all the data is coming from SQL Server.

I know that there are no limitations for ArcGIS Server and it can handle terabyte data and hence I am filtering data according to State and then District wise hierarchy and showing data after certain zoom extent. Because I know Web browsers can not display such data so dividing data by hierarchy.

Going through post1, post 2 and researching on Google too but not able to find the recommended methods to handle large data on ArcGIS Server.

So is there any recommended way or method to publish large datasets on ArcGIS Server?


texts: Splitting raster in QGIS? without cliper

texts:
I have polygon grid layer and raster image whitch want to split with my grid layer to have 9 new raster layers.

I was doing it like this guy but my QGIS stop working and shut down every time when I hit run button.

So is there another way, how to split raster with vector layer?


texts: Results not showing in SQL window in DB Manager QGIS 3.12

texts:
The following query executes in 0.149 seconds but the results will not display in the box in the bottom half of the DB Manager window, which I assume is the results window (PgAdmin returns 7 rows with same query):

select *
from region;

The query runs in PgAdmin4 and the results are shown in PgAdmin upon execution returning the 7 rows.

The view from this query can be created in DB Manager after execution and added to the canvas in QGIS.

I'm running QGIS 3.12.2 (I upgraded today to see if it would fix the issue having encountered this in 3.12 last week).


texts: Minimum system requirements for ArcGIS on Mac

texts: Just looking to buy a new-ish computer for study for my PhD. I will be using ArcGIS. I know the ideally it would be best to buy all the memory and ram I can afford but I am self-funding on a low budget. I am wondering what's the minimum spec Apple Mac I could use to run this software practically?


texts: labelsAtPosition(qgsPoint) is not working properly

texts:
I try to use function QgsLabelingResults().labelsAtPosition(qgsPoint), which gives as a result list of labels at QGIS point.

labels = QgsLabelingResults().labelsAtPosition(qgsPoint)

Problem is that list is always empty no matter I do. My question is: Does it work properly? Have you seen example of using it that works?


texts: Is there any elevation profile plugin working in MVC5?

texts:
I have MVC5 project where I use Mapbox maps to display hiking trails (based on geojson file). Lately, I decided to add elevation profile of these trails to the bottom of the map. However, thats easier said than done. I currently use Mapbox-GL, but it seems they yet dont have any plugin which could display this profile. I was willing to switch to Leaflet if necessary but while the Leaflet itself seems to be working (and is also available as NuGet package), none of the several Leaflet plugins which display elevation do, even the simplest code from tutorial doesnt work - controlElevation is always undefined

 var controlElevation = L.control.elevation(elevation_options).addTo(map);

Did also someone else had such problem? Were you able to make your elevation profile running also in the MVC project?


texts:
How would I copy a group layer in QGIS? I see that you can duplicate layers but copying a layer group is much quicker.

What am I missing, is there a standard way, plugin, or python code to do this?


texts: How can I create a pie chart of species recorded so that the colours match the symbology of the GPS points displayed in my map?

texts: I have created a map in ArcMap 10.3 showing the locations of bat sightings in a borough in London, the symbology set to show the different bat species recorded. I want to have a pie chart as an insert showing the proportion that each species makes of all the recorded sightings so that the colours match the symbology of the map. Is this possible?


texts: Update from QGIS 3.10 to 3.14 on Ubuntu with ubuntugis-unstable

texts:
I just formatted my laptop and wanted to make a fresh install of all the spatial stuff. I thought I'd use the ubuntugis-unstable ppa. But apparently this still comes with QGIS 3.10. So I wondered what is the best way to delete QGIS 3.10 from the ubuntugis unstable ppa and install it with the QGIS ubuntu-repository? Do I just add the repo to my etc/apt/sources.list and kind of overwrite the current installation?
The issue is, that I also installed grass and saga with the ubuntu-gis unstable and I'm really not sure what the best way is to keep them while updating QGIS...


texts:
I want to make a temporary scratch layer permanent but it shows  Could not make temporary scratch layer permanent. Error: Creation of field addr:street_1 failed (OGR error: Can't create field addr_str_4 in Shape DBF file, reason unknown.)
How can I fix this error?

This is my attribute table.


texts: CartoDB not showing data layer over every tile

texts:
https://interwebjill.cartodb.com/viz/191381e0-1a43-11e5-a909-0e43f3deba5a/map

I have columns for the latitude and longitude values of each point in my table but not all of them are being shown in the map.

Does anyone know of any workarounds? I would love to use CartoDB to analyze my preliminary data.


texts: Joining data based on ranking of building size per tax parcel using ArcGIS Desktop?

texts:
I have two data sets.  Each data set has a Parcel ID and square footage for building footprints.  One was created by a government agency for tax assessment. The other by a small operation that traced the footprints of buildings from aerial imagery. There is no common attribute file between the buildings, only the tax parcels. We processed the footprints to find area (ft^2), but the data set do not match.  I would like to join the government tax database to the file of the traced building footprints.

Does anyone know of a way to join the buildings by parcel by relative size?

I am using ArcMAP 10.x
Sublime Text 3.0
MS Excel 2016

Windows 7 Pro
Intel i7-4930k 3.40GHz
64 GB RAM
64-bit OS
Two NVIDIA 1080 GPU


texts:
I am trying to produce a map of last years emergency responses in my area in 2018. I am entering a CSV file into QGIS which is working fine. The addresses and Lat and Long have been verified.

I have several locations that have had multiple emergencies in the last year and my problem is that the overlapping incidents are not showing up. Any suggestion?


texts: Polygon Divider QGIS Plugin creates less equal parts (polygons) than asked

texts:
I've installed QGIS 3.16 for Windows. I digitised a polygon layer (limits of a city) and used the Polygon divider plugin to divide it in 10 equal parts (polygons).
However, as a result, it created only 9 equally divided polygons. (When I tested it, asking for 9 equal parts, it did create 9 polygons. But when I tried for an 8 equal parts division, it again gave 7 polygons).
Could please someone enlighten me?


texts: Area size of polygons with same value (building id) in GRASS GIS

texts: Is there a way to calculate the area size of multiple polygons having the same value (in this case building number) like group stats in QGIS?