texts:
I've got a PostGIS NHD layer thats not rendering in mapnik (using toposm code scripts) and I don't know why.

I've confirmed that the table data is there, positioned correctly and has the proper projection via QGIS, and the styles seem to have the table names correctly, but I'm still getting a features layer without my nhd water features.

Is there a way I can tell mapnik.render to spit out the queries its running against my PostGIS db?   Is there another way to debug this?


texts: Sourcing postcode shapefiles & census data for The Netherlands?

texts:
I would like to do some GIS mapping of the Netherlands, but I am having trouble finding official data files for the following:

ESRI shapefiles for postcodes.
Census (population) data for postcodes.
And/or lookup files to relate postcodes to other Census small areas (if they exist)

Of course I'm hampered by not speaking Dutch. Can anyone direct me to such data -preferably governmental data not commercial data.


texts: LASTools' lasview gives no output in QGIS?

texts:
I've downloaded the latest LASTools into the current folder in QGIS and have tried running lasview on a few .las files I have on hand.

As far as I can tell the files are georeferenced but I am not sure if they are classified or not. I am also using the default settings for lasview.

The process seems to run fine but it seems that there is no output at the end. The window just goes back to the select your options and LAS file stage. This might be stating the obvious, but I have tried both stating the destination as a temp file and as a designated file.

Does anyone know what I might be doing wrong?

This is the path to the lastools folder I've given QGIS in the providers menu.

C:\Program Files\QGIS 2.18\apps\qgis\python\plugins\processing\lidar\lastools

I have also tried copying the .las files to an external hard drive to eliminate the possibility of a space in the file path causing an error.


texts:
I am using ArcGIS 10.2.2

I was wondering if there is a way to fill the gaps that appear when extruding line shapefiles?

My shapefile lies on top of a DEM:

When using the extrusion option "using it as a value that features are extruded to" (which is the only one that works), I get this result:

The result is superb, but I really would like to close the gaps somehow. Is there any method of doing this?


texts: Populating attributes of smaller polygons using bigger polygons

texts:
I have polygons TAZs (Travel Analysis Zones) that do not have any county information in them. I want to populate these TAZs with COUNTYFIPS that would have county codes in which these polygons are present using County shapefiles.

I have tried intersection but it is changing the boundary of the TAZs.

How can I approach this?


texts: Problem with regression kriging using the krige command in r

texts:
I want to perform regression kriging in R using gstat. I have a SpatialPointsDataFrame which is of this form:

After I have run my glm model, in order to see which variables are statistically significant, I end up trying to apply regression kriging with:

k = krige(Jan~prop+Lat+dem, st, grd, fit_jan3)

krige can not see my auxiliary variables, giving me this error message:

Error in eval(expr, envir, enclos) : object 'prop' not found.

Any help please?


texts: Debugging AttributeError: 'module' object has no attribute 'runalg'?

texts:
I want to use QGIS and processing to run some tasks that would be redundant to do by hand. When I try to run a script as a stand alone I get the error

  AttributeError: 'module' object has no attribute 'runalg'

When I use runandload in place of runalg, I can run the script, but only from within QGIS software. Do you know what I need to do to run the scripts as a stand alone? Below is my code, I'm using QGIS 2.8.6-Wien. I am new to Python in QGIS and if there's a better/more powerful library, let me know.

import processing

# Set variables
polygon_path = "/home/pathtopolygon.shp"
line_path = "/home/pathtoline.shp"
explode_path = "/home/explode.shp"
result_path = "/home/result.shp"

# tools
general.runalg("qgis:polygonstolines",polygon_path,line_path)
general.runalg('qgis:explodelines',line_path,explode_path)


texts: How to convert a specific multipolygon to minimum polygons

texts:
I've got this kml file with one multipolygon inside.

A link for the file are here

multipolygon.zip

My goal is to get a multipolygon with the minimum count of polygons with only outer border and some holes or island. I'm not a profi in gis programs, i tried the last three days a lot of tools in qgis but with no success. I get every time a single polygon with all these small borders. Who can help me to reach my goal?


texts: Converting SLD to Esri layer or lyr file

texts: Is there a software/extension to convert an SLD to Esri. lyr format, or to import the SLD directly?


texts: Can I save a style with a SVG marker in the database in QGIS 3?

texts:
QGIS 3.2, Mac OS 10.13.5.

I have started using some svg markers in my style but now find the option to save it to a database has gone.  Is it possible to save styles with svg in a postgis database like other styles?  I really want all the data associated with the project in the database.


texts: Not sure if I'm asking the right question. Never used Google Earth Pro before, but I have a 2GB KMZ file and I can't open it. Is there a way to break it down further or is there a limit to how large a kmz can be for Google Earth Pro?


texts:
I want to add buildings/outlines of buildings to google maps(for better accuracy when retrieving information via google's location api since the address api looks at this data)

What is the current 2018 method to do this?

It used to be easy using google maps maker but that is not available anymore.

Also if i have data available to me, is there a way to automate this process?


texts: Displaying raster images that are already georeferenced in QGIS

texts:
I have a number of historical surveys that I have already digitized, georeferenced, and clipped using ArcMap 10.6.1. My office wants to try using QGIS but I am completely new to the software.

Both the georeferenced images and the clipped raster files load into ArcMap without any issues. But when I add one of the georeferenced surveys (both .tif and .jpg) as a raster layer into QGIS, it does not display correctly. The CRS for the layer is the same as the other layers in the project but it appears in a completely different area of the project.

Further, when I import the raster clips of the same georeferenced survey, they appear in the correct location. But I am only able to import the grey-scale version, not the multiband colour (and we need them to be in full colour).

Is there a way to import these georeferenced images and raster clips into QGIS without having to redo all the georeferencing work I have already done?


texts: Tooltip on Leaflet GeoJSON is in wrong place

texts:
I'm trying to label a shape drawn by GeoJSON data in a way that keeps the label visible even if part or most of the shape is off screen. The code I am replacing uses a marker given fixed coordinates and therefore it is easy to pan the map and lose that point and the marker.
I'm now trying a tooltip but it often appears in completely the wrong place. These screenshots show the park with a rough circle in blue, and the tooltip with a white shape around it.

The code
 const parkStyle = {
   stroke: '#FF0000',
   opacity: 1,
   weight: 2,
   fillOpacity: 0,
 };
 const parkLayer = L.geoJSON(park.geometry, { style: parkStyle});
 parkLayer.bindTooltip(park.name, {permanent: true, className: 'park-tooltip'});
 parkLayer.addTo(this.map);

The GeoJSON
{"type":"Feature",
            "geometry":{"type":"MultiPolygon","coordinates":[[[[174.05775,-39.20426],[173.9917,-39.228962],[173.96663,-39.25221],[173.951402,-39.29586],[173.958095,-39.32588],[173.9772,-39.3520],[174.00701,-39.37177],[174.04410,-39.38188],[174.102089,-39.378061],[174.135973,-39.36288],[174.16105,-39.33972],[174.174412,-39.311416],[174.169730,-39.26711],[174.136330,-39.22888],[174.05775,-39.20426]]]]},
            "properties":{"name":"Egmont National Park", center: [173.96481435000607,-39.1332981]}},

relevant CSS
.leaflet-touch {
  .leaflet-tooltip {
    background-color: rgba(0, 0, 0, 0);
    border: 0px;
    color: #232D45;
    box-shadow: none;
    -webkit-text-stroke-width: 0.25px;
    -webkit-text-stroke-color: white;
    margin: 0px !important;
    font-size: 14px;
    line-height: 16px;
    font-weight: 900;
  }
  .leaflet-tooltip.park-tooltip {
    border-radius: 20px;
    background-color: #FFF;
    padding-left: 15px;
    padding-right: 15px;
    font-weight: bold;
    color: #232D45;
    font-family: Roboto, "Open Sans", sans-serif;
  }
  .leaflet-tooltip-right:before, .leaflet-tooltip-left:before {
    border-color: rgba(0, 0, 0, 0);
  }
}


texts:
Are popup markers supported in Mapbox Studio?

I inherited a project which uses earlier versions of Mapbox. Today, a marketing personnel asked me because she cannot update the data that is being shown in our website. It seems that it is because the old MapBox Editor has already been deprecated by last November 2016 (https://www.mapbox.com/blog/migrating-from-editor/).

The old maps they have has popup markers like this:

Is this supported in the new MapBox Studio? How will I be able to do this especially if the popup content will be coming from the JSON datasets of the older project?


texts: ArcPy - layer.Describe not working across MXDs

texts:
I am using the following code to determine if something is selected within a layer:

if arcpy.Describe("layername").FIDSet:

It is working fine and running the following code when I first open ArcMap and run the script, but once I change MXD it stops working, and the FIDset returns empty, even though there are polygons selected as before.

Has anybody run into this/a similar problem before?

Edit:

Full syntax (on an Addin button):

mxd = arcpy.mapping.MapDocument('current')
desc=arcpy.Describe("PDS Temp")

if desc.FIDSet:
    lyrs = arcpy.mapping.ListLayers(mxd,"",arcpy.mapping.ListDataFrames(mxd)[0])
    fileName1 = mxd.filePath.split("\\")[-1]
    fileName = fileName1.split(".")[0]
    for layer in lyrs:
        if layer.longName == 'PDS Temp':
            fields = arcpy.ListFields(layer, "","String")
            rows = arcpy.UpdateCursor(layer)
            for row in rows:
                    for field in fields:
                            if field.name == "Search_Reference":
                                row.setValue(field.name,fileName)
                    rows.updateRow(row)
                    print "Search Ref Updated Successfully"
else:
    print "nothing selected"
del mxd


texts:
I am trying to load markers from a text file using openlayers text layer, but no marker is shown, text file and icons are in same directory. However I am able to show markers using marker layer. My code is here and text file is also attached, kindly help me out.

function init()
{
 /*
Create a new Map with Basic controls which are passed as
arguments
*/
var map= new OpenLayers.Map('map_element',
{
    controls:[
    new OpenLayers.Control.Navigation(),
    new OpenLayers.Control.PanZoomBar(),
    new OpenLayers.Control.LayerSwitcher(),
    //new OpenLayers.Control.Attribution()
    ],
    numZoomLevels:19,
    units:'m'
}
);

 // default lan/lat projection in which points will be provided
 var epsg4326 = new OpenLayers.Projection("EPSG:4326");
    /*
Create Basic Layers to show on map
*/
// openstreetmap layer
var osm_map_layer = new OpenLayers.Layer.OSM (
'Open Street Maps'
);
// google map layer
var google_map_layer = new OpenLayers.Layer.Google(
'Google Street Maps',
{sphericalMercator: true,
maxExtent: new OpenLayers.Bounds(
-20037508.34,-20037508.34, 20037508.34, 20037508.34)}
);

/*
vector layer to draw custom shapes on map
*/
var vectors = new OpenLayers.Layer.Vector("Vectors");
/*
markers layer will be used to insert markers on map
*/
var markers = new OpenLayers.Layer.Markers( "Markers");
    /*
layers are added to map
*/
pois = new OpenLayers.Layer.Text( "My points", { location:"./pois.txt", projection:     map.displayProjection});
map.addLayer(pois);
map.addLayers(
[
osm_map_layer,
//google_map_layer,
//vectors,
markers,
pois
]
);
//

var lonlat = new OpenLayers.LonLat(48.9459301,9.6075669);
lonlat.transform(epsg4326, map.getProjectionObject());
map.setCenter(lonlat, 15);
markers.addMarker(new OpenLayers.Marker(lonlat));

} // last closing bracket

and text file

lat lon title   description icon    iconSize

iconOffset
48.9459301  9.6075669   Title One   Description

oneSecond line.(click again to close)

Ol_icon_blue_example.png    24,24   0,-24
48.9899851  9.5382032   Title Two   Description

two.    Ol_icon_red_example.png 16,16   -8,-8


texts: Shapely polygon union results in strange artifacts of tiny, non-overlapping areas

texts:
I am not sure if this is a shapely bug or a problem with my polygons.

I have a bunch of polygons that look like this:

They are level-12 watersheds provided by HydroBasins, and are presumably non-overlapping.

I do some analysis to select a group of these polygons based on their basin ID, then join that group together to make a single, large polygon:

I have done this in four other areas without problem. However, for this polygon, I find that it actually has tiny holes, but in unusual locations:

Here's a zoom-view:

In this view, the yellow lines represent the border of the large polygon:

I should note that when displaying in QGIS, no matter how far I zoom in, the smaller polygons do not have gaps between them.

What I find unusual is that these tiny gaps seem to occur at roughly constant lines of latitude. The region is Arctic (i.e. high-latitudes), so I am wondering if they appear due to the WGS84 distortions at higher latitudes.

I am using geopandas to manage and select the smaller polygons, and shapely to join them together:

polys = []
for i in idcs:
    polys.append(gdf.iloc[i].geometry)

polyout = shapely.ops.unary_union(polys)

where "gdf" is a pandas geodataframe and "idcs" are the indices of smaller polygons I want to join together.

How can I tell if this is a shapely bug or an issue with my smaller polygons, and either way, what is the best approach to remove these? I could buffer each of the individual polygons by a very small amount before union-ing, but I would like to avoid that if possible.


texts: Change HTML page for shapefile published on GeoServer?

texts:
I have uploaded a shapefile to GeoServer. Here is how it looks when I open it in OpenLayers through Layer Preview.

OpenLayer page

I want to do the following.

I want to disable the extra options available e.g. WMS version, CQL filters, etc.
I want to disable the zoom in/ zoom out buttons.
I want to retrieve attribute values from shapefile into drop down boxes
so that user can select attributes and fire custom query.
I want to fire custom CQL/ECQL query from the user selected attributes.

Where is the html page for this OpenLayers link located? I couldn't find it in data_dir/www/ in geoserver folder.

For the time being how can I fire CQL query? I tried entering columnname = 'Value for Column' and clicked apply filter. But that did not work.

For later how can I

Retrieve data from shapefile
Fire query on click of a button for filtering


texts: Categorizing label customization in QGIS

texts:
I need to set different font sizes and different colours for my text strings, which appear in QGIS 3.x labels.
I found a solution at Setting different colors based on value when labeling using QGIS but it doesn't work in my case.
In my data attribute table, which looks like below:

I used the "text" column to define my label.
Now, I want to distinguish some strings, making them bigger (font size) and red instead of black.
Basing on the solution from the link above I prepared the simple function:
"color24" = 1
unfortunately, along with the red color, I am getting the "1" value.
In the other case, when my function looks like:
  CASE
  WHEN "Text" like '%GW%' then color_rgb (255, 0, 0)
  END

I am getting nothing.

Is anyone able to help with this?
I need to know how to change the font size and the font color on a categorized basis.

After the function:
   CASE When "Color24" = 1 Then color_rgb(255,0,0)
   end

and other settings, as seen in the image below...

gives the answer, but eventually, the result doesn't work properly.
Mainly only 1 of 3 labels are changed. They shift between older settings and new one as the zoom level changes.
How can I fix it?


texts: arcpy.UpdateCursor setting value to 0 instead of Null

texts:
I'm having issues setting a row value to 0 when joining a csv to a shapefile. When the shapefile value is not in the csv, the row is getting set to 0 instead of null. This is a huge problem as i'm showing 0 change instead of no data. I tried row.setValue(field, None) and row.setNull(field) and both produce the same result. In the .dbf file of the shapefile, there is no value but in the UI attribute table a 0 is shown.

arcpy.AddField_management(shpfile, "TEST", "DOUBLE", field_is_nullable = 'NULLABLE')

newcols = ["TEST"]

with open(csvfile, 'rb') as csvfile:
    lib = dict()
    csvfile = csv.reader(csvfile, delimiter = ",")
    csvfile.next() #skip the headers
    for line in csvfile:
        lib[line[csvjoinindex]] = lib.get(line[csvjoinindex],line[csvstartfield:])
rows = arcpy.UpdateCursor(shpfile)
for row in rows:
    shpjoinval = str(row.getValue(shapefilejoincol))
    try:
        vals = lib.get(shpjoinval)
        for ind, field in enumerate(newcols):
            row.setValue(str(field),vals[ind])
            rows.updateRow(row)
    except:
        for ind, field in enumerate(newcols):
             row.setNull(field)
             rows.updateRow(row)


texts: How to re-project a shapefile to be compatible with another shapefile or raster?

texts:
I have a polygon shapefile and a raster. The shapefile and raster have different coordinate systems.

Coordinate System for the shapefile:

NAD_1983_UTM_Zone_19N
WKID: 26919 Authority: EPSG

Projection: Transverse_Mercator
False_Easting: 500000.0
False_Northing: 0.0
Central_Meridian: -69.0
Scale_Factor: 0.9996
Latitude_Of_Origin: 0.0
Linear Unit: Meter (1.0)

Geographic Coordinate System: GCS_North_American_1983
Angular Unit: Degree (0.0174532925199433)
Prime Meridian: Greenwich (0.0)
Datum: D_North_American_1983
  Spheroid: GRS_1980
    Semimajor Axis: 6378137.0
    Semiminor Axis: 6356752.314140356
    Inverse Flattening: 298.257222101

Coordinate System for the raster:

LCC_E008
Authority: Custom

Projection: Lambert_Conformal_Conic
false_easting: 0.0
false_northing: 0.0
central_meridian: -95.0
standard_parallel_1: 49.0
standard_parallel_2: 77.0
latitude_of_origin: 0.0
Linear Unit: Meter (1.0)

Geographic Coordinate System: GCS_Unknown_datum_based_upon_the_GRS_1980_ellipsoid
Angular Unit: Degree (0.0174532925199433)
Prime Meridian: Greenwich (0.0)
Datum: D_GRS_1980
  Spheroid: GRS_1980
    Semimajor Axis: 6378137.0
    Semiminor Axis: 6356752.314140356
    Inverse Flattening: 298.257222101

I would like to transform the shapefile's coordinate system in order that the shapefile and raster have the same coordinate systems.

I tried to use the function Project in ArcGIS 10.1 by specifying:

LCC_E008 (in folder "Layers") as output coordinate system
NAD_1983_To_WGS_1984_1 as Geographic transformation (this optional parameter was required in my case)

But I obtained this error message:

000151 : The geotransformation(s) is not valid.

How can I to change the coordinate system for my shapefile ?


texts: gdal nearblack increases file size. Is this expected behaviour?

texts:
I ran gdal - nearblack on a Landsatlook image with geographic reference as follows:

nearblack -o c:\test\test_nearblack.TIF -of GTiff c:\test\LC08_L1TP_179044_20181228_20181228_01_RT.tif

The input file size is 4 Mb, output is a whopping 173 Mb. Is this expected behaviour? If so, why?

Note that the results is technically all correct, all boundary pixels are neatly set to 0,0,0. It's just that the large resulting large files are less convenient to work with.

I'm using GDAL 2.1.2.


texts:
I have made a workflow in which I pass some data from a shapefile to a PostGIS database using FME 2015. The table in the database has several columns and one of them is an id with an auto-increment primary key.

Everything was working just fine till last week but now that I tried to rerun the process I get this error:

Bulk copy failed on table 'public.foc_network_rural' using delimiter ':'. Error was 'ERROR:  null value in column "id" violates not-null constraint
 CONTEXT:  COPY foc_network_rural, line 1: "NULL:NULL:MT:RR1393RETH:010200002034080000BC0400002DE7BAF24C2521416DCF4D428CD44D41D9757D684C25...'

So for some reason the auto-increment functionality is not recognized or doesn't work.

Any idea what can cause this error?


texts: ogr2ogr PostgreSQL to geojson batch export

texts:
trying to export 20 postgreSQL tables to geoJSON using ogr2ogr
ogr2ogr -f "GeoJSON" C:\path\Desktop\geo PG:"host=localhost user=postgres dbname=free password=xx" -t_srs EPSG:4326

getting these 2 errors
ERROR 6: The GeoJSON driver does not overwrite existing files.
ERROR 1: GeoJSON driver failed to create C:\Users\Desktop\geo

I know there is a for loop option but I cannot figure out how to construct it or where to even the cmd location to write it in? in the GDAL folder
For %f in (* PG:"host=localhost user=postgres dbname=free password=xx ACTIVE_SCHEMA=public") do ogr2ogr -f "GEOJSON"% ~ nf.json% f

with my modified script
For %f in ("oak_available_parcels","oak_buffers_union","oak_nonavailable_parcels","oak_park_buffers","oak_park_parcels","oak_reccon_buffers","oak_school_buffers","oak_school_parcels","oak_worship_buffers","oak_worship_parcels","parcels","park_centroid","school_centroid","worship_centroid")
do ogr2ogr -f "GeoJSON" C:\Users\Desktop\geo\%f.json
PG:"host=localhost user=postgres dbname=free password=xx" %f -t_srs EPSG:4326

giving me this error: what is wrong with my cmd statement???
FAILURE: Unable to open datasource `user=postgres' with the following drivers

and postgres is my username for that database


texts: What cell size do I use when the raster cell size is larger than the zonal vector features for Zonal statistics as table tool?

texts:
I want to calculate the mean precipitation from a PRISM raster for a land use data layer using the Zonal statistics as table tool for ArcGIS 10.7.  The land use vector layer contains over 20,000 polygon features, the majority of which are smaller than the PRISM raster cells.  The PRISM Precipitation raster is 4 km (source data includes cell size = 0.04167 sq decimal degree units).

Both raster and vector layers are in the same coordinate system. What I input to the Zonal statistics as table tool:

Input feature zone data: Land use layer

Zone field: ObjectID

Input value raster: PRISM raster

Statistics Type: Mean

Raster Analysis > Cell size: Maximum of Inputs

The result is a zonal statistics table with about 700 records instead of the 20,000 records I would expect based on the ObjectID field I set as the zone field. The tool is only calculating zonal statistics for a subset of land use features, or a single feature of many that fit inside the 4km raster cell.

My thought is that I need to define the cell size in the raster analysis setting to a smaller cell size so that every land use feature is assigned a raster cell. I am not sure how to do this correctly, so that each raster cell is assigned to all land use polygons that fall within its area. Would this be set to Minimum of inputs, or a cell size smaller than 1? Also wondering if I need to convert units, or use the snap raster setting?


texts: Spacing/arranging multiple labels along a perimeter?

texts:
Using QGIS's permimeter-based labeling, what is the best way to arrange multiple different labels along a line so that they are visually spaced apart, instead of clustering together?

In my example, I am labeling the border between the USA and Canada, so I have a separate label for each nation, one placed above and one below the line (or left and right, depending on orientation); these should appear in pairs. I also have labels for the province above the line and the county below it; these don't have to be paired (and I don't need a label for the state below the line).

The county labels are always a separate layer. For the other labels, I've tried:

US and Canada on one layer, province on another layer (shown here)
US and Canada on one feature, province on another feature in the same layer
US, Canada and province as three separate labels on one feature

All of these produce similar results, where the labels for US/Canada are bunched together with the province or county label. How can I get the different labels to appear a good distance apart using perimeter labeling?


texts: Nearest Neighbor Focal Statistics and Map Algebra

texts: I would like to use a nearest-neighbor type analysis to iterate over a raster. The nearest neighbor analysis will give a cell value of 1 IF AND ONLY IF the cell being analyzed has a cell value larger than all adjacent cells, and 0 otherwise. Is this type of analysis possible with Arcobjects or with the raster calculator tool using map algebra?


texts: Calculating distance between two GPS locations based on Location's date?

texts: I'm using ArcMap 10.2.1. I have GPS collar data from which I'm trying to determine the farthest distance moved by an individual each day. Therefore, I need to take the first point recorded in a day and measure it to each location recorded that day. I've investigated using Near and Point Distance, however, these methods either compare all combinations of points or the ones in a self-provided buffer. Any ideas or thoughts?


texts: How to find address in QGIS using openlayers plug-in?

texts: Is possible to search for addresses using OpenLayers plugin in QGIS?


texts: Use QGIS for collaboration on a Geopackage on Google Drive

texts:
We have a few peoples working on a small QGIS project using Geopackage as the main data storage. The GeoPackage is stored on a share Google drive. By working I mean reading for now but looking for posibility to write and update layers as well.

The current workflow is that only one person works on the Geopackage at any given time to avoid conflict.

I'm investigating possibility for several people working on Geopackage file at the same time. We don't expect that 2 people could edit on the same layers at the same time but it would be great if several peoples could work on different layers of the same GeoPackage at the same time, e.g. user1 updating layer 1, user2 updating layers 2.

Do you have any hints and experiences to share?


texts:
How can I maintain perfectly equivalent raster and SpatialPointsDataFrame extents when in R?

Each time I combine rasters, or raster and point data, the extents are very slightly different (like single-digit meters or less over an area of 10000+km2). I know this results from cropping/masking different resolution rasters.

At present, I am constantly using the functions projectRaster, crop, mask, spTransform, etc... to make things line up, but there must be a better approach.


texts: What kind of map art can be used for printing/wrapping onto sphere?

texts:
I'm working on a globe project. We need to find map art that we can modify.

What is the format/projection (?) that I would need for the map art so that it can be printed and then wrapped around a globe/sphere?

Also, where is a source for these maps?


texts: How to transfer NaNs from raster to other having different dimensions?

texts:
I have one high resolution raster 1m with dimensions 12671x12756 and other a Sentinel 2A raster with dimensions 1606x1596. Both of them are of same extent but the high-res tiles has some nans and I want to transfer them to the low res tile, basically, make the same areas 0s as well.
I tried using numpy but there are lot of dimensions mismatch errors, what else can I try here?


texts: Making a transparent globe in ArcGIS Pro

texts:
In ArcGIS Pro (2.1), I'm attempting to create a 3D scene in which the underlying basemap is transparent such that I can see through the oceans.

I'm trying to get an effect similar to this.

Or this:

I've created a 3D Scene in ArcGIS Pro with just a basemap.

Reducing the  the transparency to 50% just fades the basemap and doesn't actually make it transparent.

If I turn the basemap off completely, I just get a white globe.

And adding a vector layer of countries results in this:

Is there a way to achieve a transparent globe in ArcGIS Pro? Or is this something that hasn't been implemented?


texts: How to Remove No Data from a NetCDF Raster Layers?

texts:
Question: How to remove no data from a NetCDF Raster Layer?

I am trying to use the Zonal Statistics as Table tool in ArcGIS to calculate the mean. The problem  is I am not getting the correct mean, because I have no data information inside the Raster Layer. I am able to not view the no data and change the value in symbology in properties, but still I get the incorrect mean.  I have also tried going into ArcCatalog and changing the no data, but it does not work for NetCDF Raster Layers, just Raster.


texts:
In my code, I have a button that displays information in my gridpanel and it add a vectorlayer in it. I want to add zoom on those polygon, but I did not succeed

My code:

testlayer.events.register( testlayer, function(){
map.zoomToExtent(testlayer.getDataExtent())
});

Note this code functions when I add the vectorlayer only, but when I add the action of displays information in my gridpanel it is not working.

any help is apprecited


texts:
I developed a Python plugin to import a PostgreSQL project organized in QGIS with one click. The problem is that I don't put the layers it in the correct "tree scheme" in the layer panel.

I enclose a photo of the piece of instruction.


texts: Hide and show markers in a Leaflet map using zoomend

texts:
How to hide and show markers in a Leaflet map using zoomend.

Example jsfiddle.


texts:
I have to rotate a great number of point SVG symbols (valves, caps, Te, etc.) in order to fit them with the gas distribution network. SVG rotating could be achieved by creating a field with angle attributes for each point, but this process is very long due to the great number of points.
Is there a tip or a plugin that permit the free rotation of symbols?


texts: How can I make sure that tiles display properly when you first go to the page?

texts:
This page is not showing my map tiles properly when you first go to the page.

http://bear.hol.low.li/Pocket_Docent/map.htm

If I resize the window it centers and distributes the tiles properly.

How can I make sure it tiles and refreshes correctly when the page first opens?


texts: Loading image tiff to PostgreSQL without use raster2pgsql?

texts:
I can load raster data by using raster2pgsql but i don't want to use the command line.

I want to build a desktop application.

I want to use C# or Java or matlab to load raster data without using raster2pgsql.

Can you guide me on how to do it ?


texts: Size of points determined by an attribute value in SLD in Geoserver

texts:
I have a point layer with an attribute field containing decimal values. In Qgis, with the help of data defined overide i have managed to make the size of a point dependent on the value of a field (see picture below).

Now i want to emplement this in Geoserver through SLD: Is there a way to simply "call" the value of an object from a specific attribute field and bypass it to the <se:Size></se:Size> element?
Meaning if the value within a specified attribute field is 70,5 for for a point-object the value of <se:Size></se:Size> will be 70,5.
Thanks,


texts: Joining tables that have different numbers of rows using ArcMap?

texts:
I am trying to join a table to a raster output for an assignment in ArcMap (10.7), but they both have different numbers of rows.

Is it possible to join them?


texts: unable to append zero into id when updating attribute table

texts:
I want to update attribute table BID column using below line

($id +002)

but it is not adding 00 at beginning. instead adding 2,3,4,5,......
I am very beginner and this is my first try to append zero zero into features table column.
I am somehow manage to write this

'0000' || ($id + 5)

it adding zeros but changing exceeding the id length limits


texts: Which Landsat version is appropriate to imply a supervised classification with GRASS GIS?

texts:
I need to imply a supervised classification with GRASS GIS to find build-up areas.
I want to avoid Landsat 7 images due to SLC problem.

Can I use images of Landsat 8  or it's better to use images of Landsat 5?
Are images of Landsat 8 full operational or are they in calibration/test mode?
Which version is best supported from Grass GIS (6.4 or 7)?


texts: Is it possible to extract data from point vectors according to the 'derived' feature ID?

texts:
I am comparing two slightly offset raster datasets (DSMs) in order to correct for both XY and Z offset. I am doing this by point sampling  data across both and checking for differences in elevation value. So far I have identified features common to both by placing a number of point vectors, one shapefile for each raster. I did this in the same order over both rasters so that the feature IDs were consistent for each identifiable feature in each DSM (i.e. a boulder found on both DSMs would have ID '1', a specific building would have ID '2', and so on). I have extracted the elevation data associated with each point, and this seems to have kept the derived feature ID, when checking using the identify tool. However, weirdly, in the attribute table, the points are not numbered/listed according to this derived feature ID, which means I am unable to easily make a comparison. Ideally, I'd like to list by derived feature ID, so I can then copy into a text file which would give me the X,Y and Z coordinates of each feture and I could make corrections accordingly.

Hope that makes sense... Are there any ideas of what I could do here?


texts:
I have two line layers, A and B.

Layer A is sort of a complete network (black lines on the screenshot below), layer B contains certain chunks from layer A (red and light blue lines on the screenshot).

Now I wanted to clip both line layers, to get the line parts of layer A (black) that are not in layer B.I have tried all the geoprocessing tools in QGIS, but none yielded the result I wanted.Internet research only covers polygon-polygon or polygon-line clipping, but how do I do line-line?

Important: The single features of the "black" layer are not necessarily the same ones that are red/light blue in layer B, because they have been merged or cut into new pieces, but the geometry remained the same.

On the image below, Layer A (black lines), also covering the traces of Layer B (red and light blue).


texts:
I have a map with a WFS-Layer and I am able to add Polygons to my data stored in a PostGIS-database, served with GeoServer (OpenLayers, GeoServer 2.1.4, PostGIS 2.0 for PostgreSQL 9.1).)

How can I add a description to the polygon? E.g., after drawing a polygon I want to specify the crop that are grown there, i.e. insert information into the Postgis-table-column "crop".

I found this example:

http://gis.ibbeck.de/ginfo/apps/OLExamples/OL26/examples/styles_unique_with_group_wfs.html.

The Popup type "edit name and description" would be perfect for my means, unfortunately I can't work out how it works as I have a really hard time understanding its code, greenhorn that I am...

How is it done?
Or is there an easier example/ way of how to use a popup to edit your attributes?

Here's my WFS-Layer and the tools used so far. The desired column to edit/add Information in the postgis-table "test" is "crop".

function init() {
Save-strategy
var saveStrategy = new OpenLayers.Strategy.Save();

//empty map, bounds are test-layer bounds (EPSG:32647)
map = new OpenLayers.Map({
    div: "map",
    allOverlays: true,
    maxExtent: new OpenLayers.Bounds(
    653237.69439077,1519879.063165,655229.57939001,1520825.6733868
    )
    });

//WFS-Layer Test= editable data
var test = new OpenLayers.Layer.Vector("Editable Features", {
    strategies: [new OpenLayers.Strategy.Fixed(), saveStrategy],
    protocol: new OpenLayers.Protocol.WFS({
    url: "http://..../wfs",
    featurePrefix: 'testkf',
    featureNS: "http://.../testkf",
    extractAttributes: true,
    featureType: "test",
    geometryName: "geom",
    })
});

map.addLayer(test);

//Toolbar:
    var panel = new OpenLayers.Control.Panel(
    {'displayClass': 'customEditingToolbar'}
    );

    var draw = new OpenLayers.Control.DrawFeature(
    test, OpenLayers.Handler.Polygon,
    {
    title: "Draw Feature",
    displayClass: "olControlDrawFeaturePolygon",
    multi: true
    });

    var save = new OpenLayers.Control.Button({
    title: "Save Changes",
    trigger: function() {
    if(edit.feature) {
    edit.selectControl.unselectAll();
    }
    saveStrategy.save();
    },
    displayClass: "olControlSaveFeatures"
    });

panel.addControls([save, draw]);
map.addControl(panel);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
}

EDIT:

So nobody knows anything about this topic or is there another problem with my question? I found another example, however, this is way too complex for me to understand yet: http://dev4.mapgears.com/bdga/bdgaWFS-T.html

This is exactly what I am looking for. Can anyone break it down to me what the steps are to achieve this?

Or is there any way to improve my question?


texts: How to change the color intepretation field of a GeoTIFF file using GDAL?

texts:
I have the following problem, I have a GeoTIFF file that is for now color interpreted as gray. When using gdalinfo I have the following results

Driver: GTiff/GeoTIFF
Files: out.tif
Size is 6957, 13662
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["unknown",
        SPHEROID["WGS84",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]
Origin = (92.138443059661412,28.568318690426047)
Pixel Size = (0.001364919790129,-0.001364919790129)
Metadata:
    AREA_OR_POINT=Area
Image Structure Metadata:
 INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  92.1384431,  28.5683187) ( 92d 8'18.40"E, 28d34' 5.95"N)
Lower Left  (  92.1384431,   9.9207845) ( 92d 8'18.40"E,  9d55'14.82"N)
Upper Right ( 101.6341900,  28.5683187) (101d38' 3.08"E, 28d34' 5.95"N)
Lower Right ( 101.6341900,   9.9207845) (101d38' 3.08"E,  9d55'14.82"N)
Center      (  96.8863165,  19.2445516) ( 96d53'10.74"E, 19d14'40.39"N)
Band 1 Block=6957x1 Type=Float32, ColorInterp=Gray
  NoData Value=-9999

As you can see the colorInterp is shown as gray. So is there a way to have change this to green for example. The goal of this procedure would be then to use gdal2tiles.py to have a web representation of my GeoTIFF but I want it in another color than in a grayscale.


texts: QGIS 3.4.4 PATH pointing to grass-7.4.4, but I have 7.6.0 installed thru OSGEO4W

texts:
How do I change this PATH (it says read-only and won't stick) or use the network installer to make this work correctly on Windows 10? All I want to do is use QGIS and Grass?

I've honestly been struggling with this for days, can someone answer a very simple question - does Grass work on QGIS 3.4.4 on Windows 10, and if so how do you install and configure it correctly?

Or can at least one person tell me that they've successfully tested this setup that I've described?

Here's another illustration (sorry about Trump!) which shows the issue, network installer thinks it is installing grass 7.4.4, but it's not because it writes 7.6.0 to the folders in OSGEO4W - how do I fix this? I used network installer express desktop install and had previously del everything associated with grass and QGIS...I think...


texts: Converting dimension feature class into standard feature class using ArcGIS Desktop?

texts:
I have found very little information regarding if it is possible to convert a dimension feature class into a standard feature class. This would hypothetically be done in an SDE environment. Our theory is that while dimension features are created, drawn, and displayed using a particular style, it should somehow be possible to extract the features and its attributes and store them into a standard feature class. The features still have vertices, points, or geometry. So extraction should be possible.

How can I do this using ArcGIS Desktop 10.2?


texts: Is anyone aware of freely available shapefile of Israeli sub-districts? The file I found only contained data at the district level.


texts:
Does someone know if there is a SAGA or GDAL tool that is capable of aligning two raster layers?

For the creation of a plugin I want to automate this process so the raster alignment option of QGIS won't do. A few online sources advice to use 'SAGA Resampling' but until now I did not succeed to create a set of aligned rasters. I thought this was due to the unconventional Amersfoort RD (EPSG:28992) projection, but unaligned results are also created when using the more conventional 'EPSG:3857 - WGS 84 / Pseudo-Mercator' projection. So my question is what processing tool would you recommend to align rasters? Or is there a way to write some code which uses 'Align rasters' from QGIS itself?


texts: Accessing a ShapeFile with GoogleEarthEngine-API : Invalid GeoJSON geometry

texts:
I'm trying to download Sentinel-2 data of my area of interests on Google Earth Engine API for Python.

I'm trying to access my shape file (contains 2 different polygons) on the API.  I added the shape file using geopandas as gpd.

shapefile = gpd.read_file("polygon.shp")
fc = ee.FeatureCollection(ee.Geometry(shapefile))

The Error:

Traceback (most recent call last):
  File "D:/Hacettepe/GFZ/PyScript/googleEarthEngine_S2.py", line 32, in <module>
    fc = ee.FeatureCollection(ee.Geometry(shapefile))
  File "C:\Users\polyt\AppData\Local\Programs\Python\Python37\lib\site-packages\ee\computedobject.py", line 32, in __call__
    return type.__call__(cls, *args, **kwargs)
  File "C:\Users\polyt\AppData\Local\Programs\Python\Python37\lib\site-packages\ee\geometry.py", line 83, in __init__
    raise ee_exception.EEException('Invalid GeoJSON geometry.')
ee.ee_exception.EEException: Invalid GeoJSON geometry.

I tried to find different ways to access polygons (not creating a new one), but I couldn't find any source. So I would be happy if you could help me.

[Also I'm getting "HTTP Error 403: Forbidden"]


texts: Showing text from attribute on legend patch and text from another in legend label using ArcGIS Pro?

texts:
I would like my legend to look like this with text from one attribute on the patch and text from a description attribute to be the patch label beside. I cannot work out how to do this in ArcGIS Pro.
Can anyone help?


texts: Why does the algorithm shortestpathpointtopoint in QGIS3 using pyqgis only work in the second run?

texts:
A part of my skript uses the shortestpathpointtopoint algorithm, but it does only work in the second run (Python Console within QGIS). The discussed part of the script looks like

points_lyr = QgsProject.instance().mapLayersByName(u'cabinets')[0]
network_lyr = QgsProject.instance().mapLayersByName(u'pipes')[0]

for f in points_lyr.getFeatures():
    if f.attribute('Art') == 2:
        pStart = QgsPointXY(f.geometry().asPoint().x(),f.geometry().asPoint().y())
    elif f.attribute('Art') == 4:
        pStop = QgsPointXY(f.geometry().asPoint().x(),f.geometry().asPoint().y())

print('Start: ', pStart)
print('Stop: ', pStop)

parameters = {'INPUT': network_lyr,
                'STRATEGY': 0,
                'DIRECTION_FIELD': '',
                'VALUE_FORWARD': '',
                'VALUE_BACKWARD': '',
                'VALUE_BOTH': '',
                'DEFAULT_DIRECTION': 2,
                'SPEED_FIELD': '',
                'DEFAULT_SPEED': 1,
                'TOLERANCE': 0,
                'START_POINT': pStart,
                'END_POINT': pStop,
                'OUTPUT': 'memory:'}

my_line = processing.run('qgis:shortestpathpointtopoint', parameters)

This works perfectly, but only in the second run. In the first run I get the following error:

  Traceback (most recent call last):   File
  "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\code.py", line 90, in runcode
      exec(code, self.locals)   File "", line 1, in    File "", line 37, in    File
  "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\processing\tools\general.py",
  line 96, in run
      return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context)   File
  "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\processing\core\Processing.py",
  line 139, in runAlgorithm
      raise QgsProcessingException(msg)
  _core.QgsProcessingException: Unable to execute algorithm Incorrect parameter value for START_POINT

The prints of start&stop work in the first run. I don't get what I am doing wrong here.


texts: A bug in ESRI Line Geometry WKB that adds needless, trailing 0's behind otherwise valid WKB?

texts:
[Update 7.13.2012]

My coworker noticed the the ESRI Line WKB is malformed contains unspecified trailing data, and since he's not active on GIS.SE, I posted his remarks as an answer. I'll wait a few days for critiques before accepting it in case someone has a more definitive reaction.

In the meantime, I can recreate the exception between ESRI Line Geometry WKB and SqlServer.Types by making a brand new feature class, giving it a single line geometry, and bingo---it's repeatable. Every time. But I Googled this all day yesterday and didn't find any confirmation of this. I must be a bad Googler!

[Original Post]

When I try converting an esriPolylineGeometry to IWkb, then go through the motions of exporting to wkbBytes and consuming it in SqlServer.Types.SqlGeometry.STGeomFromWKB() the conversion always fails with the error "well-known binary (WKB) input is not valid". However, if I use the same approach to get wkbBytes, it works fine when I send it through SharpMap converters. I've done everything I can imagine to rule-out poor geometries, and I'm thinking surely someone has run into this before.

On the ESRI-side, I've tried using ITopologyOperator to perform .Simplify() and .Buffer(0), and neither makes a difference. I've also tried adding .MakeValid() behind STGeomFromWKB() to no use. And there is also no difference from either IWkb.ExportToWkb() or the alternative IGeometryFactory.CreateWkbVariantFromGeometry().

So my question is: Is the WKB really invalid? If so, then why is it converting properly in SharpMap?

The WKB coming out of ESRI looks like this:

010200000009000000BA854FAC7A273541B2325A112E643341B6FB21797E273541F080DDD356643341C87DB90187273541DA6E0FE4776433410692AC108B27354140AF88AF81643341CD1A8D1FA127354163B43190B9643341486A0F7CDF2735415B63352B7065334146AFE4D2E12735411BC18BCB776533413DA83565EC273541C03198AA9E653341861DA529F02735414B65EE25C46533410000000000

Below, the first code block shows the failing approach when I attempt to consume using SqlGeometry's static method STGeomFromWKB(). The second block shows the SharpMap approach, which works when consuming the same wkbBytes data.

This approach using SqlServer.Types fails..

// At this point, feature.Shape is esriPolylineGeometry
IWkb wkb = feature.Shape as IWkb;
int byteCount = wkb.WkbSize;
byte[] wkbBytes = new byte[byteCount];
wkb.ExportToWkb(ref byteCount, out wkbBytes[0]);

// FYI: This alternate approach to get the byte[] is no different..
//IGeometry geom = feature.Shape;
//IGeometryFactory3 geomFactory = new GeometryEnvironment() as IGeometryFactory3;
//byte[] wkbBytes = geomFactory3.CreateWkbVariantFromGeometry(wkb) as byte[];

int srid = feature.Shape.SpatialReference.FactoryCode;

// It fails here noting...
// "24115: The well-known binary (WKB) input is not valid."
SqlGeometry sqlGeometry = SqlGeometry.STGeomFromWKB(new SqlBytes(wkbBytes), srid);

string wkt = sqlGeometry.ToString();
MessageBox.Show(wkt);

But this approach using SharpMap converters works.. ?!?!

IWkb geomWKB = feature.Shape as IWkb;
int wkbSize = wkb.WkbSize;
byte[] geomWkbBytes = new byte[wkbSize];
wkb.ExportToWkb(ref wkbSize, out geomWkbBytes[0]);

SharpMap.Geometries.IGeometry sharpGeom = SharpMap.Converters.WellKnownBinary.GeometryFromWKB.Parse(geomWkbBytes);
string sharpWKT = SharpMap.Converters.WellKnownText.GeometryToWKT.Write(sharpGeom);

Both approaches accept Polygon geometries, but I'm hoping someone knows how to get the SqlServer.Types approach to work on Line geometries, as we have other projects already using that library. I won't hesitate to use SharpMap converters if that is the answer, but it bothers me that an unknown condition is causing SqlServer.Types to fail in the context of Line geometries. :/


texts: How to extract portion of a string for a field value

texts:
This is simple but driving me mad. I am using Modelbuilder to iterate through a folder of feature classes, and need to add a field that extracts a portion of the filename.

Example:
CF0140r01.shp
I want to add a field to the its table that is titled Image, and wish to just extract the portion of the file name from character positions 3-6 so the resulting field has a value of 0140

I have LOTS of these files, and each one has the Image number embedded in the file name, always at the same positions (two leading Text characters, 4 digits for Image number, three trailing characters with more information)


texts:
I'm following an MIT tutorial I found here: https://libraries.mit.edu/files/gis/geocoding.pdf, to try to add a locator to ArcMap.

However, as I am not an MIT student, I cannot get to the step where I need to: "Download the ESRI data & maps data from IS&T."

I'm specifically looking for the "Street_Addresses_US" file to geolocate US addresses. I have access to ArcMap Desktop subscription, but cannot find access to these files.


texts: How to use WHERE CLAUSE to filter the features by its attribute in PyQgis?

texts:
How to Get features by their attributes (similar to Iqueryfilter in arcobjects) in Qgis using python? Instead of getting all features and filter it manually, is there any option to use whereclause to filter it out?

For Example: I have a field name called 'Counties'. It has more than fifty thousand of features.i.e not possible to fetch all features and filter it because of time consuming. So i can query it by using iqueryfilter.whereclause = 'Counties = Norwich' in arcobjects. Similar thing i need in PyQgis. kindly let me know whether its doable. If so, please give me an example


texts: What is the difference when measuring in units rather than meters?

texts:
I have a function that takes a point and compares it with lines that are stored in PostGIS and then gets the line closest to the point. Initially I did not transform the data because I did not think that it would matter when I want to get the minimum distance. I thought that small distances (up to 100m) would not need transformation but I was wrong! Sometimes it gets a line that is not the closest one even if the compared distances are 1.2m and 2.5m. I discovered that and I re-designed the SQL command to transform the point and line to the local UTM zone and now its working fine.

I would appreciate it if someone could explain to me how is this possible at such a small scale.  Why did PostGIS think that a line 2.5m away from my point is closer than a line 1.2m away? Perhaps an emphasis on UNITS vs metric unit usage?

Thank you for your time and effort!
Regards,
A


texts: QGIS 3 embedded forms - zoom or pan to child features

texts:
I have two tables and a relation defined on them via an 'in-between-table' (many-to-many relationship) like this:

This gives me nice embedded forms like shown below:

What I would like to achieve is to zoom or pan to a child feature listed in the embedded form.

In the form view I tried:

(A) Activating zoom or pan to selected feature seems to have no effect in embedded forms, just in "normal" form view attribute table
(B) The button 'Zoom to child features' is allways greyed out and sometimes vanishes (even when child features exist) an never returns.

The attribute tables table view has a context menu with entries like 'Zoom/Pan to Feature', thus it would be obvious to try the same in the table view in embedded forms, but herein the context menu looks slightly different (menu cut at top and bottom):

This is all in all especially weird, when the parent table has no geometry and there is no chance to zoom or pan to child features of a distinct parent feature.

Can someone reproduce this and / or tell me how to achieve this 'zoom to child feature'?


texts:
I have been having this problem too often.
My only fix is to shut down arcmap and restart.
I can't find why it is happening.
Anyone else see this?
export to pdf watch it go all the way through and when it should show the file progress (processsing) bar it just goes away and says export complete, but the file is 0kb.
arcmap 10.0 sp 2

Not only have I tried refresh, restart, shutdown. I have tried to open the file. the message is...

It seems there is something to do with either the original file or arcmap.
I tried to create a jpg "export" from arcmap and get the "can't map metafile to memory" error.
But another document will export both pdf and jpg.
Then a coworker opened it and exported immediately.
It also occurs on other machines though.
I cnan't nail down any consistent behavior except that it always doesn't show the file status bar after processing the data and successfully writes a file (0kb).


texts: Automating Select By Attributes and Calculate Field?

texts:
I have zero experience with python and very little experience with ModelBuilder in ArcGIS. I have a shapefile with two fields, let's say their names are "Function" and "Regulation". What I need to do is to select by attributes from the field "Function" and write a specific text in the field "Regulation". Now I'm doing it manually, e.g. I select by attributes where "Function" is 'sport' and then via field calculator I write the text into the field "Regulation". Then I select by attributes other fields in "Regulation" and so on.
What I want to do is to automate the whole process, because in the future I'll do this for other shapefiles with similar values in the fields, so my idea was to have a script, where I would only rewrite the values which are different.

Any ideas how to do it?

I've tried these scripts:

Expression:
Reclass (!Regulation!)

Code Block:
def Reclass (Function):
    if (Function == "sport"):
        return "400_TXT\888_B.txt"
    elif (Function == "water"):
        return "400_TXT\888_D.txt"

and this one:

 def Reclass (Function):
    dict = {
    "sport" :"400_TXT\888_B.txt"    ,
    "water" :"400_TXT\888_D.txt"    ,
    }

I had an error "field is not nullable", so I tried these scripts in the feature class in gdb, but the fields were not updated.


texts: ogr2ogr conversion error - Can't create fields of type Binary on shapefile layers

texts:
I'm having trouble using the ogr2ogr tool on the command line. My data is stored in SQL as binary, type is mixed polygons and multipolygons. I am using the following command for conversion from SQL to shapefile:

ogr2ogr -f "ESRI Shapefile" "H:\PolandSQLQuery\test_shp\test3.shp" "ODBC:USERNAME/PW@SERVERNAME" -sql "SELECT TOP 1 ID, GEOMETRY::STGeomFromWKB([polygon].STAsBinary(),4326) FROM [eQUIP75CEEFloodCzechRepublic].[dbo].[CZ_Hist2002_3308238]" -overwrite -nlt POLYGON -a_srs "EPSG:4326"

My error message is:

ERROR 6: Can't create fields of type Binary on shapefile layers.

I have tried numerous things, such as STGeomFromText and .ToString() conversion et al. I am using GDAL 1.11.1 (2014/09/24) with the newest MS SQL driver.

Any ideas?


texts: How to create a surface area that interpolates and visualizes trends in physical activity in ArcGIS?

texts:
I have a dataset that contains several hundred telemetry points for my focal species around twilight hours.  Attached to these points are mean values that represent how active the animal was 10 minutes before and after the GPS point was taken. That is, when the animal is inactive, the cooresponding point will have a value of 0, whereas if the animal is incredibly active (such as running), the value goes up to 175. As this data deals with wildlife, you can imagine that it is zero -inflated (animals rest a lot) and likewise, there will be some overlapping areas with high and low values .

Is there a way to spatially interpolate this data as a means to visually assess areas where the animals are generally more active or inactive in ArcGIS?

EDIT: Here is the closest example that I can find from the literature (Mosser et al. 2014; while the questions are still somewhat different, the basic concept is similar. Unfortunately, It did not describe exactly what she method she utilised for visualization.


texts: No layers when configuring TinyOWS with MapServer

texts:
Am trying to expose a vector layer (loaded from shapefile into PostGIS) as a WFS layer using TinyOWS.

Following the instructions in the mapserver/tinyows documentation, here is the .map file I have come up with so far:

MAP
    NAME "world"
    CONFIG "MS_ERRORFILE" "/home/balajeerc/Projects/Build_Dir/myproject/data/logs/mapservice_errors.log"
    EXTENT -180.000 -90.000 180.000 90.000

    WEB
        METADATA
            "tinyows_schema_dir" "/home/balajeerc/Projects/Build_Dir/myproject/deps/mygis-services-0.1/data/schema"
            "tinyows_onlineresource" "http://192.168.43.164:19090/vectors/world/wfs?"
            "wfs_title" "MyGIS Feature Service: World"
            "wfs_contact" "support@giscompany.com"
            "wms_title" "MyGIS Feature Service: World"
            "wms_srs" "epsg:4326"
            "wms_enable_request" "*"
            "log_level" "15"
            "log" "/home/balajeerc/Projects/Build_Dir/myproject/deps/mygis-services-0.1/data/logs/wfs_world.log"
            "ows_contactorganization" "GeorbisServer"
            "ows_contactelectronicmailaddress" "contact@giscompany.com"
            "ows_contactperson" "Balajee.R.C"
        END
    END

    PROJECTION
        "init=epsg:4326"
    END

    LAYER
        NAME 'world_boundaries'
        CONNECTIONTYPE postgis
        CONNECTION "host=localhost user=mygis password=asdf123 dbname=mygis port=19095"
        DATA "geom from world_boundaries"
        TYPE POLYGON
        METADATA
            'wfs_title' 'world_boundaries'
            'wfs_namespace_prefix' 'tows'
            'wfs_namespace_uri' 'http://www.giscompany.com/'
            'wfs_srs' 'epsg:4326'
            'wms_srs' 'epsg:4326'
            'wms_title' 'world_boundaries'
            'tinyows_table'  'world_boundaries'
            'tinyows_writable' '1'
            'tinyows_retrievable' '1'
        END
        CLASS
            STYLE
                COLOR 128 128 128
                ANTIALIAS true
            END
        END
        PROJECTION
          "init=epsg:4326"
        END
        DUMP TRUE
    END
END

This .map file works fine with MapServer, i.e. I am able to render the feature layer as a WMS service using QGIS as a client.

However, the WFS service (served by tinyows) using the same file (set using TINYOWS_MAPFILE environment variable seems to show no layers in GetCapabilities (and hence QGIS is not able to load any).

The output from tinyows --check is as follows:

balajeerc@Balajee:~/Projects/tinyows-1.1.1$ ./tinyows --check
TinyOWS version:   1.1.0
FCGI support:      Yes
Config File Path:  /home/balajeerc/Projects/Build_Dir/myproject/data/service_data/data/wfs/world.map (Mapfile)
PostGIS Version:   2.1.8
PostGIS dsn:       host=localhost user=mygis password=asdf123 dbname=mygis port=19095
Output Encoding:   UTF-8
Database Encoding: UTF8
Schema dir:        /home/balajeerc/Projects/Build_Dir/myproject/deps/mygis-services-0.1/data/schema
Display bbox:      Yes
Estimated extent:  No
Check schema:      Yes
Check valid geoms: Yes
Available layers:
balajeerc@Balajee:~/Projects/tinyows-1.1.1$

Note that even though I am using a 1.1.1 version of TinyOWS, it prints TinyOWS version as 1.1.0. Also note that it prints no layers.

Wondering what is going wrong, I decided to step into the code. I recompiled code after turning off (-O2) optimizations and with debugging (-g) enabled.

I am only able to get so far as the ows_parse_config method in src/ows/ows_config.c. I am, for some reason not able to step into ows_parse_config_map in src/mapfile/mapfile.c. This probably has something to do with the fact that mapfile.c is generated by flex using src/map/mapfile.l.

At this point I am completely stuck and at a brick wall as to what might be going wrong. Can someone here please help?


texts: Merging shapefiles in a folder using PyQGIS

texts:
I was reading the QGIS Python Programming Cookbook (page 74) trying to learn how to merge shapefiles because I need to do it for what I'm doing.
I was using their example just to try it out though.

I would like to know if there's any way to merge all the shapefiles in a folder together to make one shapefile.

Theses are the files in my folder:

footprints_ne.dbf
footprints_ne.shp
footprints_ne.shx
footprints_nw.dbf
footprints_nw.shp
footprints_nw.shx
footprints_se.dbf
footprints_se.shp
footprints_se.shx
footprints_sw.dbf
footprints_sw.shp
footprints_sw.shx

And this is my code:

import os
import glob
import urllib
import sys
import zipfile
import processing

pth = "C:/Users/myself/Desktop/qgis_data/tiled_footprints/"

files = glob.glob(pth + "*.shp")

out = pth + "merged.shp"

processing.runandload("saga:mergeshapeslayers", files.pop(0), ";".join(files), out)

For some reason it gives me an error complaining about my algorithm but I'm just following the book. I am new to programming.


texts: Symbology of point layer using CSS class

texts: There is nice feature DivIcon in Leaflet library. Is it possible to get the same function using OpenLayers? I guess I can make some workaround using Markers but not sure is this a right way. Now I'm using vector layer and have to load image for each layer separately, but in CCS case it is possible to use only one sprite for all layers.


texts: Points in shifted with different projected coordinate systems in same map

texts:
I am trying to map points on top of a map of Michigan taken from eBird a citizen science platform that records where birds were sighted. I downloaded an excel file for ebird sighting points, to use in ArcMap. eBird points are recorded through the WGS 84 datum, but my map of Michigan is on the Projected Coordinate System NAD_1983_Michigan_GeoRef_Meters. When I add the eBird data and it defaults to the NAD 83 coordinate system the points appear about 45 degrees southwest of where they should be in Illinois/Iowa instead of northern Michigan. When I use the Define Projection and Projection tool to set it at WGS_1984_Web_Mercator_Auxiliary_Sphere the points appear in the same place.
Any thoughts on where I am going wrong?


texts:
I have a shapefile consisting of 10 contiguous polygons. I want to reduce this to a single polygon encompassing the entire area of the existing 10. I don't need to retain data.

I've googled but without the proper terminology I get pointed to Merge and Clip functions which I don't think are what I am looking for.


texts: Unable to connect to connect to Postgres server using DB Manager: unable to convert a QVariant of type 10 to a QMetaType of type 2

texts:
Using QGIS 3.0.3 and QGIS 3.1 nightly, I can't connect to a postgres Database using the DB Manager and get the following error:

  TypeError: unable to convert a QVariant of type 10 to a QMetaType of type 2

I get the same error when I try to open the "Import into PostGIS" function in the Processing toolbox.

However the browser has no problems connecting to the databases.

Does someone know how to solve this error and be able to use PostGIS with the DB Manager on QGIS 3?


texts:
How can you animate symbols in ArcMap?  I am not looking for anything complex, just a simple symbol that flashes or changes a little.

I know that you can perform animation in ArcMap but I am not interested in temporal mapping, just animated symbols.


texts: Why does ArcMap edit session show different vertex count on feature than arcpy/ ArcToolbox

texts:
I am looking at features in an ArcSDE geodatabase via ArcMap.  The feature shows to have four vertices by viewing the vertices in the map and by looking at the sketch properties.

However if I run a feature vertex to point tool i get 5 vertices.  If I get an arcpy.SearchCursor row object and do row.pointCount I get 5 vertices reported.

I even exported the feature class out to a shapefile and got the same results.

Whats going on here?  Thanks.


texts: Adding turf.js polygons from shapefiles?

texts:
I'd like to know if there is any tool I can use to import polygons from a shapefile.

Is there any way to import a feature class in turf format or I should use GeoJSON?


texts: In Operations Dashboard, how do you get the widgets to adjust when you click on a point on your map?

texts: I created a dashboard with several different widgets. They do update when I add filters to the layers. However, when I click on a point (school) all that happens is that the point is highlighted. When I right click, I can "show pop up" and other things. What I want to do is for the widgets to update when I click on any one point.


texts: Determine distance between two lines at multiple locations

texts:
We have a number of features that look something like this:

I need to measure the distance between the edges of a track (two lines) for all the tracks, and flag locations where the track width exceeds a given value (15 ft). Currently, an analyst does the process manually:

buffer the feature by 7.5 ft, looking for areas where the buffers don't overlap in the middle
using the measure tool to confirm width
draw lines across to mark divisions
draw sub-polygons so feature can be color-coded (green where it doesn't exceed width, red where it does)

I want to automate this process, and it doesn't necessarily need to be done in the same fashion if there's a script. (In other words, it's obvious how to script buffer-making, but not how to script the measuring process, so that probably wouldn't be the process if I Pythonize this.) I hope to get suggestions/framework for how (methods/approaches/tools, not code) to proceed with this.

We have Arc 10.1, all extensions.

EDIT:
Buffering to those areas where the original buffers don't meet, as suggested in @radouxju's solution, will not work the way I need because it ends up overestimating the total area of "too-wide" tracks. We want to have linear breaks between the different width class sections (see red, below), and buffering will have rounded breaks (see dashed purple, below) which increases the size of the too-wide segments.

Unfortunately, this accuracy matters. (I've argued this issue -- they got the boundary data from GPS points while walking along the track edges, which introduces its own set of inaccuracies, but they still want the results so we'll just do what we can with what we've got...)


texts: How to define a line's width graduated by its attributes?

texts:
I have a line shapefile with lots of lines that have different attribute values. I want to present these lines in different widths according to their attribute values without classes but a graduated symbolization based on each attribute value.

Is there any way of doing this without defining different classes by myself?
It is intended to create a radial flow map with different line widths as a combination of the following examples: Creating a Radial Flow Map and: Generating Distributive Flow Maps

I would prefer to do it with ArcMap, but I am also open to trying it with QGIS.


texts: Deleting multiple fields with same shapefile name using ArcGIS Desktop?

texts:
I have many shapefiles. Each shapefile has a specific name which is the same as one of the column of data within the attribute table. For each shapefile, I would like to delete all the fields that don't have the same name as the shapefile name.

For example, shapefile might be named m_1. Within its attribute table, there will be lots of columns, which are named "gid", m_1, m_2, m_3, m_3 etc. I would like to delete all those fields except the column "gid" and "m_1". Below is my code, which doesn't work.

I'm new to programming.

import arcpy
arcpy.env.workspace = "D:\Paper"
fcList = arcpy.ListFeatureClasses()

for fc in fcList:
    field_names = []
    field_names = [f.name for f in arcpy.ListFields(fcList)]
        if field_names <> fcList:
            arcpy.DeleteField_management(fc, field_names)


texts: Color matching between Google Earth and Google Maps (same KML)

texts:
I'm working on a custom Google Map using API v3. I'm creating my KML files in Google Earth, uploading to Maps and then accessing the KML from there. I'm having problems matching polygon colours to the defaults in Maps - everything looks fine in Earth, but when viewing it on google maps, the colours have shifted.

How the KML looks on Google Earth:

How the KML looks on Google Maps:

You can download the KML here.
KML file.

Is anyone can help me with this issue?


texts: Downloading large data sets on overpass-turbo?

texts:
I'm trying to download historical data from overpass-turbo and I keep getting this error.

Error: runtime error: open64: 0 Success /osm3s_v0.7.54_osm_base Dispatcher_Client::request_read_and_idx::timeout. The server is probably too busy to handle your request.

This is after trying to increase the timeout and maxsize on the query and using the "raw data directly from Overpass API" export function. I need to do this for all of US and Canada.  Breaking it up by state and province is fine or one big download will work as well.  Am I exceeding the limits and need to find another way of doing this?  The files don't seem to be too big.  California is about 10MB and Ohio is about 2MB.  Here are my basic queries.

 [adiff:"2016-10-23T15:00:00Z","2017-10-22T15:00:00Z"];

{{geocodeArea:california}}->.searchArea;
(
  way["highway"="motorway_link"](area.searchArea);
);
out body;
>;
out skel qt;

[adiff:"2016-10-23T15:00:00Z","2017-10-22T15:00:00Z"][timeout:99999][maxsize:10737418240];

{{geocodeArea:california}}->.searchArea;
(
  way["highway"="motorway_link"](area.searchArea);
);
out body;
>;
out skel qt;


texts: Generate a polygon based on 2 points along an axis

texts:
I have a polygon feature, inside it, 2 points along an axis.

I draw a line perpendicular to the axis (where the points are) until I intersect the border of the polygon, to get the 4 “sides” of the polygon I am looking for.

And ideally, I wanted to get this directly through “arcpy”.

What’s the best way to obtain this? The solutions I am thinking of, are way too complicated and/or not precise enough.

I am probably missing something there.


texts: How to Merge polygons while zooming out using leaflet?

texts:
I have created a map using leaflet, with polygons. Each polygon has its proper color(style) based on the number of inhabitants.
please see the following example: Map

I want to merge polygons as I zoom out. for example: after every 2 zoom levels, I want to aggregate 2 adjacent polygons into one, where the inhabitant number of the new polygon is the addition of the volumes of the previous 2 aggregated polygons. I found that there is a method called turf.union that is able to merge polygons. But the issue that I have is in term of the algorithm that will be identifying adjacent polygons and returning them. How can I achieve that? is there any library that can help me achieve that ?


texts: Reconciling RGeo spheroid calculations with PostGIS

texts:
I have a Rails/Postgresql app that uses a combination of RGeo and PostGIS, and I'd like to move more calculations in to RGeo and reduce some of the load on the database. One of the problems I'm having is doing length calculations on the spheroid instead of the sphere. From the RGeo::Geographic docs (https://www.rubydoc.info/github/rgeo/rgeo/RGeo/Geographic):

  Some geographic implementations include a secondary factory  that
  represents a projection. For these implementations,  you can quickly
  transform data between lat/long coordinates  and the projected
  coordinate system, and most calculations  are done in the projected
  coordinate system. For  implementations that do not include this
  secondary projection  factory, calculations are done on the sphereoid.

There are three ways to make factories in RGeo::Geographic:

RGeo::Geographic.projected_factory, which lets me include a factory for an arbitrary Proj4 projection
RGeo::Geographic.simple_mercator_factory, which includes a factory for the SRID: 3857 projection
RGeo::Geographic.spherical_factory, which does not include a projection factory but explicitly does calculations on a spherical Earth.

The first two of those include a projection, so according to the docs calculations are done in that projection. The last one doesn't include a projection, but is specifically done on a spherical Earth. So it's unclear how to do calculations on the spheroid.

Ultimately, the thing I'm really trying to reconcile is the results of calculating the length of a linestring in RGeo with the results from calculating the length of a geography type linestring PostGIS.

If I have the following linestring:

LINESTRING(2.3565473 48.8518338,2.3566331 48.851804,2.3580518 48.8512945,2.3580839 48.851283,2.3581316 48.8512659,2.3589446 48.8509735,2.35903847509631 48.8509397089643)

Calculating its length in PostGIS:

On the sphere: select st_length(way,false) = 207.625186169259 m
On the spheroid: select st_length(way,true) = 208.114332509536 m

Calculating it in RGeo:

On the sphere: RGeo::Geographic.spherical_factory.parse_wkt(way).length = 207.85748843579324 m
On the spheroid: ?

I understand that these differences are small, but I'd like to be consistent, at the very least for writing tests, and because I am going to be using both RGeo and PostGIS and don't want "errors" accumulating between them. The length of these linestrings is important.

Is it possible to get these values to be the same (/ do calculations on the spheroid in RGeo) or just an inevitable result of implementation differences?


texts: ArcGIS Toolbox Tools visible in Pro, not in Desktop?

texts:
I created these tools in desktop years ago and they worked up until yesterday and then they just disappeared in desktop? I can see them in Pro, but not desktop? Any reasons as to why this happened? I made no changes to the tools, but I do believe I viewed them in Pro at one point.

ArcCatalog:

ArcGIS Pro:


texts:
I used the Create Mobile Map geoprocessing tool in ArcGIS 10's toolbox to generate a mobile map from an MXD. The MXD has one layer which featureclass is:

1) in a geodatabase
2) registered as versioned and
3) has a globalid

all the ridiculous requirements for generating a mobile cache just to take advantage of ArcGIS Mobile's mapping capabilities (like I couldn't send my edits back to my own webservice and manage edits my own way).

I then took the MapSchema.bin file and dropped it in a folder on my Windows Mobile device. I wrote a small test Smart Device application in Visual Studio that has this code:

        using (MobileCache cache = new MobileCache(mobileCachePath))
        {
            cache.Open();

            FeatureLayer layer = cache.Layers[0] as FeatureLayer;
            FeatureDataTable table = layer.GetDataTable();

            FeatureDataRow row = table.NewRow();
            row["area_id"] = 1;
            table.Rows.Add(row);

            int recordsAffected  = table.SaveInFeatureLayer();
            //recordsAffected is always 0

            using(FeatureDataReader reader=layer.GetDataReader(null,null))
                while (reader.Read())
                {
                    //never reaches here
                }

            table = layer.GetDataTable(new QueryFilter("area_id="+1));
            int foundRows = table.Rows.Count;
            //foundRows is always 0

            cache.Close();
        }

As you can tell from the comments in the code, I can't find my new records anywhere. I open the MobileCache.db file in a Sqlite browser and the tables are empty. I read that I could use the MobileCache in a headless fashion, is this not what ESRI meant? Can anyone fill me in on what I'm missing? OR EVEN BETTER does anyone know another mobile mapping API that is SIMPLE (just plot stuff on a map already for crying out loud), works with locally stored maps and stores geometry in some open format?


texts: Linking two GeoJSON data files using Python?

texts:
I am new to using GIS data in Python. I have two datasets in GeoJSON format. One of them has states of a country with multi-polygons representing each states. The other has multiple points of latitude and longitude, each one describing a particular branch information (also in the same country).

I am looking to integrate these two GeoJSON files so that I can get something like all the branches or the number of branches located in a particular state.

How can this be done in Python?

I've attached the code so far and the results that I've obtained below.

import geopandas as gpd
import geojson, json

fname_states="/home/anaconda/gis_test/USAStates.json"
fname_branches="/home/anaconda/gis_test/branches.json"
with open(fname_states) as fs:
    data_states = json.load(fs)
with open(fname_branches) as fb:
    data_branches = json.load(fb)
for feature in data_states['features']:
    print (feature['geometry']['type'])
    print (feature['geometry']['coordinates'])

  MultiPolygon
  [[[[-155.666192384, 18.921786345999976], ............,
  [-160.073803717, 22.00417732599999]]]]

  MultiPolygon
  [[[[-122.40201532499998, 48.22521676600002],..............,
  [-122.96797834099999, 48.443794749999995]]]]

I've just attached two polygons output statement for reference. These coordinates indicate polygons which refer to a region.

for feature in data_branches['features']:
    print (feature['geometry']['type'])
    print (feature['geometry']['coordinates'])

  Point [-84.11397141, 35.97929825] Point [-84.17377774, 35.89437917]
  Point [-83.84168579, 36.22807494] Point [-83.92360125, 36.08801205]
  Point [-84.02843334, 35.93056813] Point [-84.00351839, 36.04683377]
  Point [-83.97332803, 35.97456329]

This is the output of the branches file which also contain numerous other fields like branch id and other attributes.

So, I would like to add an extra field to the branches data as 'state'. I want to obtain this field by checking whether it lies in any of the regions that are covered by polygons in the states GeoJSON file. This is where I need help.

Please suggest an optimal method to achieve this.


texts: Display simple raster file in openlayers

texts:
I have raster files (one sample can download from here) just have values for points and in beside i have top-left and bottom-right geo data and pixel size of file.
so i want to just simply display this in openlayers 3.
if i can choose colors for high and low values it will be good.
in server side i can access postgis and all it's raster functions.

Can you help?


texts: How to filter by Selected Objects in eCognition?

texts:
I was wondering if there is any options in eCognition Developer to filter by selected objects. Suppose if I select some objects with polygon selection tool and want to use 'assign class'. In the algorithm windows I will set selected objects as 'filter' so that the algorithm will only work in the objects I selected previously.

I can do this by assigning a new class (ie. test class) to all those objects and filter by 'test class', but I want to skip this tedious step. Besides this will blend all other classes together.


texts: GPX to line doesn't work properly in ArcMap?

texts:
When I add GPX layers (this one, for example) through the GPX to feature tool in Arcmap, the layer shows up as points logically.

Then I try to convert these points to a polyline (in this case bicycle routes) using the points to line tool but the lines always show up strangely, like this:
Sorting field with OBJECTID doesn't change it, neither does 'close line' option.

What should I do?

Image for clarity:

]


texts: Determining distance of point to shape in certain orientated direction

texts:
I have a point (in the middle of the sea) and I have to measure the distance from this point to the land.

Normally I can use the measure tool.

However, if I have to know exactly the distance from this point to the land but exactly in the NW direction, then I s there a way to create "orientated" (N, S, W, E..) lines so that I can use the field calculator to measure the distance?


texts:
I have the following ewkb strings from PostGIS:

01 01000020 E6100000 AECB9307F9D81240 0F2ADCE003704940

01 01000020 E6100000 7EAA0A0DC4920DC0 5AF0A2AF201F4440

I've been able to understand every data field except from the bolded ones, those are supposed to be binary masks to specify that the data represents a point and some extra info, but I've not been able to guess what masks and how are they applied in this particular case.


texts: Clipped Image has wrong shape in Google Earth Engine

texts:
In the Google Earth Engine Python API, when I select a polygon around a high latitude region and use .clip() to clip an image to the polygon (in my example I used MODIS landcover data, but it seems to be happening to every other dataset I look at) the result is an image with curved top and bottom edges. How do I resolve this so the image is clipped to the boundaries of the polygon? An example of the code and a resulting image are below, with the polygon also highlighted:
boundaries = ee.Geometry.Polygon([[[4.1103796959,75.8666447688],
                               [36.5792269069,75.8666447688],
                               [36.5792269069,81.1817566002],
                               [4.1103796959,81.1817566002],
                               [4.1103796959,75.8666447688]]])

clipped_img = ee.ImageCollection('MODIS/006/MCD12Q1')\
                    .select('LC_Type1')\
                    .filter(ee.Filter.calendarRange(2010,2010,'year'))\
                    .first()\
                    .clip(boundaries)


texts: Migrating PostgreSQL table with Lat Lon columns to existing PostGIS database

texts:
I am having Postgres database table with Lat Lon columns (degree, minutes, seconds) as shown below :

CREATE TABLE population (
  id double precision,
  idno text NOT NULL,
  place text,
  state text,
  district text,
  lat_deg double precision,
  lat_min double precision,
  lat_sec double precision,
  long_deg double precision,
  long_min double precision,
  long_sec double precision,
  dis_population double precision,
  date timestamp without time zone,
  "time" timestamp without time zone,
  CONSTRAINT pop_pk_idno PRIMARY KEY (idno) );

I already have PostGIS database.

How would I migrate the above PostgreSQL table with data into PostGIS database?

And after migration, is there any other modification required in migrated PostGIS table to expose it as Layer in Geoserver?

I have executed below SQLs to spatially enable the table :

 1. SELECT AddGeometryColumn('population', 'latlongeo', 4326, 'POINT', 2);
 2. CREATE INDEX populationindex  ON population USING GIST ( latlongeo );

Now, how do i convert the latitude and longitude columns to a PostGIS POINT geometry as I have 3 columns for lat & long. (Deg, Min, Sec) and the below function allows only lat, long 2 columns: ST_GeomFromText(), ST_SetSRID().

How do I convert the Lat&Lon Degree,Min,sec 6 columns to PostGIS POINT geometry?


texts: Leafletjs get latlng center position of polyline

texts:
After drawing a polyline, I would like to draw a circle from the center of this line whose radius encompasses the entire line.

For polyline's that have more than 2 points I can crudely get the center point like this:

// Get middle latLng on polyline
var streetLatLngs = layer.getLatLngs();
var numPoints = streetLatLngs.length;
var middleIndex = Math.round(numPoints / 2);
var centerPoint = streetLatLngs[middleIndex];

var circle = L.circle(centerPoint, 100);
circle.addTo(map);

Which produces:

However as you can see when there are only 2 points, I can't calculate the center latlng, and I can't guarantee that the middleIndex is actually the middle point.

Once I have that I can get the radius with:

Math.round(streetLatLngs[0].distanceTo(streetLatLngs[numPoints - 1]) / 2);

which correctly produces the circle raduis:


texts: Create Two Ellipse/Arcs from Straight Line Segments

texts:
I have thousands of straight line segments (all separate features). I need to convert each straight line segment into two arcs, with the arcs opposite of each other. For example, I used the XY to Line tool and selected Great Circle line type to create the arcs. That gives me one arc, but I need an arc opposite of that (like a reverse great circle arc). It does not necessarily have to be a great circle arc, just an arc of some sort. I have also tried to use the table to ellipse tool and it does not work as I anticipated.

The picture below explains what I am trying to do. The red line is the straight line which I already have. The blue lines are what I am needing. I can get the top blue line by selecting Great Circle in the XY to Line tool, but I somehow need to create another arc in the opposite direction, which is what the bottom line represents.

I am using ArcGIS for Desktop 10.2.2 Advanced and have full access to any tools/features.


texts: ArcGis JS: Radius of circle created by Editor Toolbar

texts:
The Editor class has this option to show the toolbar (toolbarVisible:true). I want to modify the toolbar's "draw-end" event so I can control the radius of the circle.

The toolbar has a 'circle' option, but when you place the circle the radius appears to be arbitrary when I want it to be 10.


texts: How to find out if a file geodatabase was compressed?

texts:
I work with a bunch of file geodatabases and some of them are compressed. I want to find out quickly which ones are and which aren't. The Compress File Geodatabase Data GP tool doesn't seem to have any check before running. I don't want to run File Geodatabase Data GP tool on uncompressed geodatabases though; I just to know whether they are compressed/uncompressed.

I could grab some random feature class / table and try starting editing session to see if it will let me do that (because you can't edit data that is compressed), but am looking for a more elegant solution. Ideally this would be an ArcPy/Python solution which I could use for going over multiple geodatabases.


texts:
After failing to successfully install QGIS 2.14.2 Essen on my Mac OS X 10.7.5 (Lion) I thought I could try a previous version of QGIS.

What download file should I use from the QGIS "all releases" list?


texts:
I'm writing a ArcGIS JS project, in which user will upload KMZ which will be displayed on map, since ArcGIS doesn't have a magic trick to do it, I want to convert KMZ to JSON (or KML) and then display that JSON.

I've already tried https://github.com/sntran/kmz-geojson , but I don't think it works anymore. It says package is moved and asks to install 'toGeojson' Package which doesn't support KMZ.

I've tried doing it with zip.js but stuck at zip.blobreader(blob) is not a constructor. I've tried usong jsZIP but still no luck.


texts: Error 000725 when using bearing to distance tool?

texts:
I try to use a tool called bearing distance to line, when i try to use this tool an error message appears on the screen:

  WARNING 000725 Output Feature Class: Dataset ....... already exists

and the new layer isn't created. the solution on the help which is to enable the ovewrite the outputs of geoprocessing operations in the toolbar does not help


texts: How can I cluster geographically 1886 polygons in QGIS knowing that I need 69 clusters with 27 polygons by cluster and one with only 23 polygons?


texts: Include non-raster object in overlay function in R

texts:
I have two raster objects and I would like to calculate values of the first conditional on values in the second. I am currently using the overlay function, but unfortunately I can't seem to pass non raster objects into the function.

As a toy example, r1 includes the values, r2 includes the conditions, and depending on the value of r2, I want to multiply r1 by a value (either .25, .5 or .75). (I know in this example I could just replace 1 with .25, etc. but I just created this as an example).

r1 = raster(nrow=5,ncol=5)
r2 = raster(nrow=5, ncol=5)
r1[] = runif(length(r1))
r2[] = round(runif(ncell(r1),min=1,max=3))

f_calcIt = function(a,b){
z = rep(NA,length(a))
i = which(b == 1)
z[i] = a[i] * .25
i = which(b == 2)
z[i] = a[i] * .50
i = which( == 3)
z[i] = a[i] * .75
return(z)
}b

out = overlay(r1,r2, fun = f_calcIt)

This works, but I would like to do is include the scalars (0.25,0.50,.075) that are currently hardcoded in the function as a vector, and import into the function. For example,

d = c(.25,.50,.75)

f_calcIt = function(a,b, d){
    z = rep(NA,length(a))
    i = which(b == 1)
    z[i] = a[i] * d[1]
    i = which(b == 2)
    z[i] = a[i] * d[2]
    i = which(b == 3)
    z[i] = a[i] * d[3]
    return(z)
    }

However, the use of this function returns an error that the formula is not vectorized.

Outside of creating a mirror raster with the scalar values in every cell, is there a way to accomplish this using overlay?

The reason that I would like to do so, (and assume others would also), is because it is not always convenient to hardcode values into function, especially if you want to reuse the functions.


texts: Find all polygons containing points specific criteria

texts:
I have two tables (PostGIS), one containing points, and the other containing polygons.

Right now i have this query for finding polygons (Laravel framework):

        $polygon = DB::connection('pgsql')
        ->select(DB::raw("SELECT row_to_json(fc)
             FROM ( SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features
             FROM (SELECT 'Feature' As type
                , ST_AsGeoJSON(ST_Transform(geom,4326))::json As geometry
                , row_to_json((SELECT l FROM (SELECT areal) As l
                  )) As properties
               FROM jbb2013 As lg WHERE gid = 1208749 OR gid = 692891 OR gid = 993224 OR gid = 1171857 OR gid = 1176873) As f )  As fc;")
            );

With some work i get the results as GeoJSON, i then send that to Leaflet.

As you can see i specify the the polygons by id. That's not what i want to do. I'd like to use the other table containing points and find the points by a specific customer_id.

So something like this:
Find all points that belong to a specific customer_id
Use those points in a ST_Contains query to find the polygons that contain the points.
The resulting GeoJSON should then only contain the polygons found by the query.

Result (jbb2013 is the polygons table and samples is where the points are stored):

$polygon = DB::connection('pgsql')
        ->select(DB::raw("SELECT row_to_json(fc)
     FROM ( SELECT 'FeatureCollection' AS type, array_to_json(array_agg(f)) AS features
     FROM (SELECT 'Feature' AS type
        , ST_AsGeoJSON(ST_Transform(lg.geom,4326))::json AS geometry
        , row_to_json((SELECT l FROM (SELECT areal) AS l
          )) AS properties
          FROM jbb2013 AS lg, (SELECT geom FROM samples WHERE customer_id = : customer_id) AS pts WHERE ST_Intersects(lg.geom, pts.geom)) AS f )  AS fc;"),
            array('customer_id' => $customer_id)
        );


texts: QGIS SAGA functions failing "... following layers not correctly generated. ..."

texts:
I've been having an issue with the SAGA functions for a while now, I believe since upgrading to one of the early 3.x versions. No matter which function I use they all fail with the same error (screenshot below). GRASS and GDAL functions work fine. The way our network is set up, I'm frequently wrestling with extremely long file paths, but I still get the error when testing with a copy on the desktop. In writing this up I have been able to get it to work after running Fix Geometries on some files but not on others, and that is the first time I've seen a SAGA function succeed in months. None of the files I'm working with are large, and I get the error regardless of apparent data quality of source. All the data I'm working with used to have no issue with the SAGA commands up until a few months ago.

I've been having this issue across various 3.x versions, using Windows 10 64bit. I've been using QGIS for ~2 years now and have not seen these issues up until maybe six months ago. I'm now using the 'QGIS 3.6.0 with GRASS 7.6.0' installed using the standalone installer. I've been running more attempts than I normally do as I try to gather info for this post, and am seeing intermittent success instead of consistent failure.
Seeing that people have been running the commands fine, I wanted to try again and generate some better error logs for folks to look at. I opened an new untitled QGIS project in QGIS 3.6.0 with GRASS 7.6.0. Brought in a point file of address points, a polygon file of property parcels and a line file of roads. Ran a 10 ft buffer using SAGA on each of them. It failed twice in a row on the points, succeeded on the polygons and lines. I then tried running Thiessen polygons on the points, another command that has produced failures for me -- this was just to see if could get an error log from a different SAGA command, since I've been seeing it across multiple commands. The Thiessen polygons failed as well. It failed again after running QGIS 'Fix Geometries' command on the point file.
I then opened QGIS 3.6.0 without GRASS, just to see, ran the same SAGA buffer command on the same point file and it succeeded(!). I then started a new project in QGIS 3.6.0 with GRASS 7.6.0, ran the same 10 ft SAGA buffer on the same point file and it also succeeded(!??). I then tried running SAGA thiessen polygons on the same point file and it failed again.

I saved most of the logs from these attempts and put them into Google drive: https://drive.google.com/drive/folders/1fOWhkdfXLYRDvh9OmjJzZlJ5K0XEaQNe?usp=sharing


texts: ArcGIS 10 Add-ins - How to adjust the size of an add-in toolbar?

texts: I've built an add-in toolbar with two buttons.  Works great, but I'd like to make the toolbar a little wider so that the user can see it's full caption. Is there a property I can adjust in the Config.esriaddinx file to force the toolbar to be wider? Or do I have to make each of my button images wider?


texts: QGIS crashes when using Interpolation (TIN) from Python Console in QGIS, but works well when using GUI

texts:
QGIS 3.16.5 seems to crash when I use the following code block in the QGIS console.
However, there seems to be no issue at all when clicking through the same options using the GUI. The TIN interpolator works as expected when plugging-in through the GUI.
I have gone through the answers Calling interpolation plugin from Python console of QGIS and Interpolation (TIN) from Python Console in QGIS
import qgis.analysis
import qgis.core

file_path = 'D:/codebase'
pathToFile = f"{file_path}/gpd_df.shp"
layer = QgsVectorLayer(pathToFile, 'input','ogr')
layer_data = QgsInterpolator.LayerData()
layer_data.vectorLayer = layer
layer_data.zCoordInterpolation=False
index = layer.fields().indexFromName("altitude")
layer_data.interpolationAttribute = index
layer_data.sourceType = QgsInterpolator.SourcePoints
interpolation_method = QgsTinInterpolator.Linear

tin_interpolator = QgsTinInterpolator([layer_data], interpolation_method)

export_path = "D:/codebase/test.tif"
# also tried export_path = "D:/codebase/test.asc"

rect = layer.extent()
res = 10
ncol = int( ( rect.xMaximum() - rect.xMinimum() ) / res )
nrows = int( (rect.yMaximum() - rect.yMinimum() ) / res)
output = QgsGridFileWriter(tin_interpolator, export_path, rect, ncol, nrows)
output.writeFile()
iface.addRasterLayer(export_path, "output")

gpd_df.shp (which loads as expected when used through GUI) file looks like the following table in the image attached.


texts:
This question has been asked, but I can't seem to find an answer suitable for a non-computer programmer.  A link would be great, or a quick 'how-to'.

I updated to Dufour (2.0.1) and have run into a problem where the python plugin 'matplotlib' requires 'dateutil'.  Message boards have said I can get this by installing 'matplotlib' through OSGeo4w.

A) Is this true?

and

B) If so, how would I do this?


texts:
I have a vector shape file with the basins of South Carolina. Some of the sub-basins polygons have a "hole" or no data pixel in their boundary (See photos for reference 2) and I need them to be joined to the corresponding adjacent sub-basin. I've tried using Delete Holes, v.clean from grass, Fix Geometries without any luck. I'm using QGIS 3.14.
I also thought about rasterizing the layer, but the problem is that I will also attribute a value to all the ND values that are outside the state. I could do it by hand but this would take forever, wanted to find a more efficient way.


texts: Calculate raster volumes within polygons - GDAL & Python

texts:
I have a shapefile with 625 polygons.
I have a .tif raster DEM file at a 1m resolution.
Objective: get 625 values that describe the volume of the raster (above 0m elevation) within each polygon. (since the resolution is 1m, that would be the sum of all the values above 0 inside the polygon)
Context: the polygons are wards of London (625 regions within London), I need to know the built up volume within each ward.
Complication: the raster only partially covers the area covered by the shape file. I only want the volume within a polygon to be calculated if the area of raster coverage within the polygon = the area of the polygon itself (i.e. if raster data is only available in parts of the polygon, I would like to write volume as  as 0/NA)


texts:
I will create buffer for 5 meter in start point of line string, If any other line string is within the buffer but not snapped then to mark as the startpoint as dangle error.I have attached the sample image given below, I don't want to get snapped element.
How to get it using PostGIS query?


texts: Looking for a basic PostGIS viewer to use as basis for own application

texts: I'm looking for a rather basic PostGIS viewer. It should be possible to pan, zoom and retrieve coordinate information on mouse click. No need to support coordinate transformations. It should introduce as little further dependencies as possible. Preferably written in C++.