texts: Getting ArcMap to recognize csv column as float and not int?

texts:
I am trying to show a .csv file (2 columns, 291 rows) in ArcMap 10.2 using Catalog window to drag the .csv file into ArcMap.  The second column of the .csv is a floating point number (range is [0-1]), however ArcGIS is treating that column as an int.  That is: I can view the column as numeric with decimal places in Excel, text editor, etc., but when I open the table in ArcMap the column is reduced to 0, 1 or null.  All non integers are replaced to null.

How to I ensure that ArcMap 10.2 reads the column as a float?

I have tried the following, but none have worked:

Re-ordering the observations so that observations with decimals are in the first eight rows (since I believe Arc looks at the first eight rows to determine data type).
Editing the scheme.ini file to indicate column 2 has the datatype float.  (But I may not be doing this correctly.)
Saving the .csv file with an alternative delimiter.
Changing the column in Excel from numeric to text.
It's not possible to change the field from int to float as implied by this question/answer thread: Preparing CSV files for use in ArcGIS Desktop? question/answer
Adding a text "dummy" in the first 8 lines (also suggested by Preparing CSV files for use in ArcGIS Desktop? question/answer) that is text (to try to force the field into text so that I can convert to float in Arc) also did not work.


texts: Building efficient multi geometry type database with PostGIS?

texts:
I'm trying to build a PostGIS database which must be able to store (multi)points, (multi)linestrings and (multi)polygons. The goal is to efficiently querying the data with ST_Intersects and other related functions.

My first look was at GeometryCollection. I thought that was tailor-made for my needs, i thought i'll just dump various geometry types to a GeometryCollection, create an index and forget about it. Well, then i realized that ST_Intersects does not support GeometryCollection.

So my plan B is to store each data type independently in a column (with indexes of course) and query the database using OR clauses for each data type column like:

WHERE (ST_Intersects(a_geometry, point_geometry) OR ST_Intersects(a_geometry, linestring_geometry) OR ST_Intersects(a_geometry, polygon_geometry))

With proper indexes set, this looks efficient, but in this day and age i suspect there must be some better way? Some better approach that is common enough but i am not aware of?

All queries on database will be SELECTs. Data insertion will be a one time process.


texts: Access geodatabase simultaneously by several users

texts:
We have a requirement to edit a Geodatabase simultaneously by several users.

We have several GIS specialists who are loading the data at the same time and each time we have to copy paste the data from different servers onto one geodatabase. I have tried several options such as ArcSDE basic edition and ArcSDE enterprise all the options are very expensive.

Is there any other way to access the geodatabase at the same time by several users?


texts: Converting GDAL Raster to a Boost Python Array (C++)

texts:
My Python project has a C++ extension that accepts detection coordinates to crop a GDAL raster, and then return the crop to the Python side.
On the C++ side, I create a uint8_t buffer to hold the crop. Then I performed RasterIO on my GeoTiff dataset, reading it into the buffer. I then created a NumPy array with the buffer data.
class GDAL {

    public:
        GDALDataset* geoTiffDataset;
        GDALDriver* pDriver;
        double geotransform[6];      // 6-element geotranform array.
        int NROWS, NCOLS, NLEVELS;     // dimensions of data in Geotiff.

        GDAL(const char* filename) {
            GDALAllRegister();
            pDriver = GetGDALDriverManager()->GetDriverByName("GTiff");
            geoTiffDataset = (GDALDataset*)GDALOpen(filename, GA_ReadOnly);
            NROWS = GDALGetRasterYSize(geoTiffDataset);
            NCOLS = GDALGetRasterXSize(geoTiffDataset);
            NLEVELS = GDALGetRasterCount(geoTiffDataset);
            geoTiffDataset->GetGeoTransform(geotransform);
        }

        ~GDAL() {
            GDALClose(geoTiffDataset);
            GDALClose(pDriver);
            GDALDestroyDriverManager();

        }

        ndarray Translate(const char* output_path, int x1, int y1, int width, int height)
        {

            uint8_t* buf = (uint8_t*)CPLMalloc(width * height * NLEVELS * sizeof(uint8_t));

            geoTiffDataset->RasterIO(GDALRWFlag::GF_Read, x1, y1, width, height,
                buf, width, height, GDT_Byte, NLEVELS, NULL,
                0, 0, 0);

            py::tuple shape = py::make_tuple(height, width, NLEVELS);
            py::tuple stride = py::make_tuple(width * sizeof(uint8_t),
                * sizeof(uint8_t), sizeof(uint8_t));

            np::dtype dtype = np::dtype::get_builtin<uint8_t>();
            np::ndarray ndImg = np::from_data(buf, dtype, shape, stride, py::object());

            free(buf);
            return ndImg;
        }

BOOST_PYTHON_MODULE(CentroidCorrectExt) {

    Py_Initialize();
    np::initialize();

    py::class_<GDAL, boost::shared_ptr<GDAL>,
        boost::noncopyable>("GDAL", init<const char*>()).
        def("Translate", &GDAL::Translate);
}

I then returned the crop to the Python side and displayed it with OpenCV's imshow(). However, it seems like the cropping is incorrect. The returned crop is a colorless image, even though printing array.shape showed that it has 4 channels.

What the crop should look like (4 color channels).

Is this a problem caused by how I called RasterIO()? Or is the NumPy array shape or stride that I initialized is incorrect?


texts: PostgreSQL equivalent of ArcGIS "Eliminate" function?

texts:
I am looking to eliminate small slivers in a shapefile dataset using PostgreSQL. What would work to dissolve features < 0.1 hectares into the neighbour with the longest shared boundary (1) or the neighbour with the largest area (2)?

Basically I want to do what the Eliminate function can do in ArcGIS.

I am attempting to call an instance of a connection to the PostgreSQL database in Python then run the eliminate SQL in there.

I am very new to PostgreSQL.


texts:
I am using gdal_merge.py to merge different mosaic rasters each contains 20 bands with different names. However, when using gdal_merge.py the bands are renamed as band1, band2, ..., band20. How can I keep the original bands name?

my code is gdal_merge.py -n -9999 -of GTiff -o merged_Spectra spectra1.tif spectra2.tif


texts: QGIS-streets network: How to get the points equistant at a certain distance from one point given?

texts:
Into a network of streets (let’s suppose polilines or polygons): How to get  the points equistant at a certain distance from one point given?

I know how to do this with ArcGIS with Network Analyst  but I can’t use it now and I wonder if somebody can help me with QGIS.


texts:
I am running a geodjango application with mapnik and tilecache. Currently tilecache is run on another server to decrease the load on the application server. The application server has nginx as the webserver while tilecache is run on the apache server. Now we have a requirement that necessitates us to put both the map and application parts in the same server.

Could you please tell me how to configure tilecache url in nginx server?


texts: How to convert *.shp files to *.gmt format type files?

texts:
I am new at using GMT (Generic Mapping Tools) and I am wondering if it can use a shapefile of a hydrographical network.

Can I perhaps change my .shp to .gmt format and combine it with a GMT map? If so, how?


texts:
Fascinated by the idea of a 'crowd map' and 'citizen journalism', I've been perusing Ushahidi and it should serve me well. I would like to emulate it except for - the base map.

I would prefer a personal base map(s) served from Geoserver for instance and not the Google Map. I see OSM can also be used but it lacks the detail I require.

Any ideas on How-To or alternative projects?

[I've literally scrounged the web via Google search for answers without success. The Ushahidi forum has not been helpful as well]


texts:
Versions
PostGIS Bundle 3 for PostgreSQL x64 12
pgAdmin 4.24
pgrouting 3.1.0
I have also enabled the postgis and pgrouting extensions on a public schema.
I am only just starting with pgrouting so I am new to all the concepts. I am trying to follow a tutorial from pgrouting.org to find the shortest path between points on a network. I have created a table with their sample data and inserted the values.  I have created the edge table using:
CREATE TABLE edge_table (
    id BIGSERIAL,
    dir character varying,
    source BIGINT,
    target BIGINT,
    cost FLOAT,
    reverse_cost FLOAT,
    capacity BIGINT,
    reverse_capacity BIGINT,
    category_id INTEGER,
    reverse_category_id INTEGER,
    x1 FLOAT,
    y1 FLOAT,
    x2 FLOAT,
    y2 FLOAT,
    the_geom geometry

INSERT INTO edge_table (
    category_id, reverse_category_id,
    cost, reverse_cost,
    capacity, reverse_capacity,
    x1, y1,
    x2, y2) VALUES
(3, 1,    1,  1,  80, 130,   2,   0,    2, 1),
(3, 2,   -1,  1,  -1, 100,   2,   1,    3, 1),
(2, 1,   -1,  1,  -1, 130,   3,   1,    4, 1),
(2, 4,    1,  1, 100,  50,   2,   1,    2, 2),
(1, 4,    1, -1, 130,  -1,   3,   1,    3, 2),
(4, 2,    1,  1,  50, 100,   0,   2,    1, 2),
(4, 1,    1,  1,  50, 130,   1,   2,    2, 2),
(2, 1,    1,  1, 100, 130,   2,   2,    3, 2),
(1, 3,    1,  1, 130,  80,   3,   2,    4, 2),
(1, 4,    1,  1, 130,  50,   2,   2,    2, 3),
(1, 2,    1, -1, 130,  -1,   3,   2,    3, 3),
(2, 3,    1, -1, 100,  -1,   2,   3,    3, 3),
(2, 4,    1, -1, 100,  -1,   3,   3,    4, 3),
(3, 1,    1,  1,  80, 130,   2,   3,    2, 4),
(3, 4,    1,  1,  80,  50,   4,   2,    4, 3),
(3, 3,    1,  1,  80,  80,   4,   1,    4, 2),
(1, 2,    1,  1, 130, 100,   0.5, 3.5,  1.999999999999,3.5),
(4, 1,    1,  1,  50, 130,   3.5, 2.3,  3.5,4);

At this point I have created the geometry using:
UPDATE edge_table SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2))

After that I create some topology with :
SELECT pgr_createTopology('edge_table',0.001);

Then I try to use the pgr_dijkstra() function and it's at this point the wheels come off.
The textbook I'm following gives the following input as an example:
SELECT pgr_dijkstra('SELECT id, source, target, cost FROM edge_table', 16,9,false,false);

But it throws this error.
ERROR:  function pgr_dijkstra(unknown, integer, integer, boolean, boolean) does not exist
LINE 1: SELECT pgr_dijkstra('SELECT id, source, target, cost FROM ed...
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
SQL state: 42883
Character: 8

The table


texts: Exporting model to Python script in QGIS?

texts: Where has the export model to Python script option gone in QGIS 2.6.0?


texts: What is the fastest way to digitize features on a map?

texts:
I'm currently using QGIS basically to trace a bunch of polygons to show individual ponds from google maps. Some of the geometries can be pretty oddly shaped and using the nodal digitizing tool gets pretty tedious if you have thousands of ponds.

Is there a better way or software for drawing? I'm imagining something like in photoshop where you can click and hold while tracing the shape instead of needing to click and line up each node.


texts: Change the background color of a AxTOCControl

texts: I'm having trouble finding a way to change the background color of the AxTOCControl.  Is there an easy way to do this?  I'm using ArcEngine 10 C# and VS2010.  Thanks


texts:
I wish to incrementally find the neighbour distance which maximises Moran's I test statistic. I have read that the I values are not comparable across varying spatial weight matrices but that the z-value should be maximised instead. Where can I find/how can I compute the z-value in lm.morantest from spdep package? I don't see a z-value either in the value or in the structure of lm.morantest printed to the console (same applies to moran.test for a single variable):

library(spdep)

lm.morantest(lm(pat_ct~pub_ct, sca_ct), w_dist, alternative="two.sided")
#Global Moran I for regression residuals

#data:
#model: lm(formula = pat_ct ~ pub_ct, data = sca_ct)
#weights: w_dist

#Moran I statistic standard deviate = 12.155, p-value < 2.2e-16
#alternative hypothesis: two.sided
#sample estimates:
#Observed Moran I      Expectation         Variance
#    3.556003e-02    -8.665431e-05     8.600474e-06

str(lm.morantest(lm(pat_ct~pub_ct, sca_ct), w_dist, alternative="two.sided"))
#List of 6
# $ statistic  : num [1, 1] 12.2
#  ..- attr(*, "names")= chr "Moran I statistic standard deviate"
# $ p.value    : num [1, 1] 5.39e-34
# $ estimate   : Named num [1:3] 3.56e-02 -8.67e-05 8.60e-06
#  ..- attr(*, "names")= chr [1:3] "Observed Moran I" "Expectation" "Variance"
# $ method     : chr "Global Moran I for regression residuals"
# $ alternative: chr "two.sided"
# $ data.name  : chr "\nmodel: lm(formula = pat_ct ~ pub_ct, data = sca_ct)\nweights: w_dist\n"
# - attr(*, "class")= chr "htest"

I assume a minimal reproducible example is not required to answer this generic question.


texts:
is there a way to generate route inside given polygon and starting point with azimuth. End result should be similar to something like picture below.
If such solution doesn't exists, what would be approach to make it?


texts: I would like to show points moving on a map by date

texts:
I would like to create a map where I can see points moving.
I have table of points for example with a date column,

A 01/01/2012
B 02/01/2012
C 03/01/2012
D 04/01/2012
E 05/01/2012
F 06/01/2012

I would like to show them date after date ( 01/01/2012, 02/01/2012...):
First screen we will see only the point A,
second screen will show us B ...

How can we do it? I am using QGIS and Mapinfo.


texts: Working with Python program in QGIS 2.18

texts:
I am learning Python programming and after follow the falling tutorial at http://www.qgistutorials.com/en/docs/getting_started_with_pyqgis.html when typing the follow script

output_file = open('c:/Documents/test/airports.txt', 'w')
for f in layer.getFeatures():
    geom = f.geometry()
    line = '%s, %s, %f, %f\n' % (f['name'], f['iata_code'],geom.asPoint().y(), geom.asPoint().x())
    unicode_line = line.encode('utf-8')
    output_file.write(unicode_line)
 output_file.close()

I am getting the following errors:

output_file = open('c:/Documents/test/airports.txt', 'w')
Traceback (most recent call last):
File "<input>", line 1, in <module>
IOError: [Errno 2] No such file or directory: 'c:/Documents/test/airports.txt'

for f in layer.getFeatures():
    geom = f.geometry()
    line = '%s, %s, %f, %f\n' % (f['name'], f['iata_code'],
    geom.asPoint().y(), geom.asPoint().x())
    unicode_line = line.encode('utf-8')
    output_file.write(unicode_line)
output_file.close()

File "<input>", line 7
output_file.close()
SyntaxError: invalid syntax

Can someone tell me the correct way to fix this?


texts: Shrinking / expanding map area of Google Earth Engine online editor

texts:
I often shrink / expand the map area of Google Earth Engine online editor depending on what I'm doing, if coding or seeing the results.

Are there shortcuts for these actions?


texts: Processing OS Highways data into a network dataset

texts:
I am looking for advice in how to process highways data into a network dataset in ArcGIS for use in the Network Analyst extension

My company has a partners contract so i have access to the data, but I do not know how to process from the GZ format into shp files? I also have a Network Analyst extension.

We have limited access to other tools so looking for a free method!


texts: Validating range domains when editing feature service in ArcGIS Online?

texts:
I have a feature class and a range domain is applied to a field. I know we can use the "Validate Features" command for validation.

When the feature class is published to ArcGIS Online and exposed as a feature service, how is validation applied? Is it automatic?


texts: "ERROR: operator does not exist: geometry public.&& geometry" after changing PostGIS extension schema

texts:
I just moved PostGIS extension (I have version 2.5) from public schema to another (mob) schema by following the docs at this official PostGIS page.
I did:
ALTER DATABASE mob_odm
SET search_path = public,mob;

UPDATE pg_extension
  SET extrelocatable = TRUE
    WHERE extname = 'postgis';

ALTER EXTENSION postgis
  SET SCHEMA mob;

 ALTER EXTENSION postgis
  UPDATE TO "2.5.4";

Now GeoServer (version 2.17.2) seems to raise errors everytime I make getFeature requests to a WFS. This used to work just before this change. It fails with this exception:
<?xml version="1.0" encoding="UTF-8"?><ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://localhost:8080/geoserver/schemas/ows/1.1.0/owsAll.xsd">
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>java.lang.RuntimeException: java.io.IOException
java.io.IOExceptionERROR: operator does not exist: geometry public.&amp;amp;&amp;amp; geometry
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Where: SQL function &amp;quot;st_intersects&amp;quot; during inlining</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

The query in the log is this one:
SELECT count(*) AS gt_result_ FROM (SELECT * FROM "mob"."signal_geo_outbound" WHERE ("level" IN ('level1', 'level2', 'level3') AND "level" IS NOT NULL  AND "db" = 'XXX' AND "db" IS NOT NULL  AND "freq" = 'daily' AND "freq" IS NOT NULL  AND "isdiag" = 0 AND "isdiag" IS NOT NULL  AND "geom" && ST_GeomFromText('POINT (1389121.0076528117 5486502.466631511)', 3857) AND ST_Intersects("geom", ST_GeomFromText('POINT (1389121.0076528117 5486502.466631511)', 3857)) AND "time" = '2020-09-20 00:00:00.0' AND "time" IS NOT NULL ) LIMIT 1000000) gt_limited_

The problem seems to be in the call to ST_Intersects:
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Where: SQL function "st_intersects" during inlining

I am not that expert in using PostgreSQL, but from this answer I understand I would need to check that

PostGIS extension must be installed in a schema that must also be in
the user search path

select e.extname,n.*
from pg_extension e, pg_namespace n
where e.extnamespace = n.oid and e.extname='postgis';

>>> extname | nspname | nspowner | nspacl
>>> postgis | mob     | 16,384   | NULL

And you can check if the schema where it is installed is in the user
search path by issuing

show search_path;

>>> search_path
>>> "$user",mob,public

I don't know if I am supposed to do anything else, or if I have to move postgis back to the public schema in order to make GeoServer work.
The reason why I did that is that I am performing spatial queries to the database with a JavaScript library called pg-promise that is initialized in my case to work in the mob schema and could not work before making this change (now it works).
I also tried to restart GeoServer after moving the postgis extension to the different schema, but it did not solve the problem.


texts: Identify duplicate attributes (followup)

texts:
I am processing a large map with several hundred thousand building polygons in QGIS 2.18. Unfortunately I had to puzzle this map together from several smaller and overlapping pieces and so quite a few of them appear multiple times. Since I need to aggregate the building data later I need to get rid of the multiple polygons now.

The Polygons all have ID’s (string, non-consecutive) and so I hoped it would be possible to filter out the duplicates in the attribute table. I found a python script under
Identify duplicate attributes
which (as far as I understand it) should be a simple and elegant solution

from qgis.core import *
from qgis.gui import *

@qgsfunction(args='auto', group='Custom')

def FindDublicate(IDfield, feature, parent):
  uniqueList = []
  if IDfield in uniqueList:
    return 1
  else:
    uniqueList.append(IDfield)
    return 0

However, it does not work for me: The return is always ‘0’.

Can somebody tell me how the script should be such that it works under QGIS 2.18.1 or if there is an alternative solution to the problem?

Sidenote:
I also tried several methods to clean the geometry but none of them worked: GRASS GIS 7 function v.clean does not show any effect, and MMQGIS delete duplicate tool simply leads to QGIS crashing.


texts: I don't understand the expected specs for GeoJSON data in OpenLayers whether readFeatures() / readFeature() / readGeometry() are used?

texts:
I work on a GIS web app using GeoDjango and I struggle reading and displaying a multipoint geometry on my map.

If I serialize my GEOSGeometry object to GeoJSON, I can get the following JSON file :

{ "type": "MultiPoint", "coordinates": [ [ X0, Y0, Z0 ], [ X1, Y1, Z1 ], ... ]}

Now, when I want to read this data using readGeometry() as follows

var vectorSource = new ol.source.Vector({
        features: (new ol.format.GeoJSON()).readGeometry(geojson_object),
    });

I get the error SyntaxError: JSON.parse: expected property name or '}' at line 1 column 3 of the JSON data

I tried parsing my data using GeoJSONLint but it does seem correct.

So I tried to use readFeature() (as I only have one feature) as a matter of testing with slight modification to my geojson file :

{ "type": "Feature", "geometry" : { "type": "MultiPoint", "coordinates": [ [ X0, Y0, Z0 ], [ X1, Y1, Z1 ], ... ] } }

Then I get TypeError: n.features.getArray is not a function

Again, if I use readFeatures() on the same feature object, I get no error whereas it should expect a collection of features, right ?

What am I missing ? The openlayers documentation is not that clear to me.


texts: Catching and canceling event when I press button using PyQGIS

texts:
I develop a script. When I select a feature from layer and press delete selected, I want to execute my function that checks something for this feature, and if the checker function returns False, it cancels the deletion. I write this code, but when I try to delete something, it does not cancel the deletion.
def feature_deleted( fid ):
    feature = layer.dataProvider().getFeatures( QgsFeatureRequest( fid ) ).next()
    if fid=1:
        #now I want to cancel the delete
        layer.removeSelection()
        qgis.utils.iface.actionRollbackEdits().trigger()
        iface.mainWindow().findChild(QAction, 'mActionDeselectAll').trigger()
    else:
        #nothing -- continue deleting

layer.featureDeleted.connect( feature_deleted )


texts: Use metres instead of px in Leaflet styles

texts:
As far as I can tell, Leaflet styling units are always pixels. I need to style things in geographic units (technically "mapunits" derived from the projection, but just metres would be a good start).

How can I write style rules to express eg the width of a line feature in metres, not pixels?


texts: Using pg_routing to connect point to closest point of set of points

texts:
Imagine we have the location of a person (point) and 100 restaurants (each is a point). My objective is to calculate the path from the person to the nearest restaurant (just one), but I want to avoid calculating 100 shortest paths (which is what pgr_dijkstra one-to-many does), because it is time consuming.
Logically, this should be possible, as Dijkstra's algorithm analyzes cost cumulatively.  Therefore, if the algorithm has already reached the first restaurant and the cost is 50, then all paths whose cost is higher than 50 could be dropped.
How can I implement this in PostgreSQL, preferably using pg_routing?


texts: How to find isolated geometry/attributes in road network?

texts: I have a road network with paved/unpaved status in attribute table. This road network don't must contain isolated paved geometry. There are any solutions find isolated geometry in GIS software (ArcGIS/QGIS or other)?


texts: ArcGIS-Location "Location 1" in "Stops" is unlocated in Online Routing

texts:
I was trying to run a sample project "Routing" provided by ArcGis Runtime SDK. I tried the code but when the method solve() of RouteTask class is executed, it throws the following exception without returning any routes:

  com.esri.core.io.EsriServiceException: Unable to complete  operation.
  Location "Location 1" in "Stops" is unlocated.  Location "Location 2" in "Stops" is unlocated.  Need at least 2 valid stops.  "Stops" does not contain valid input for any route.

I am not able to figure out what the actual problem is. Here is the link for the sample code and the code looks like this:

        map.setOnLongPressListener(new OnLongPressListener() {

        private static final long serialVersionUID = 1L;

        public boolean onLongPress(final float x, final float y) {

            // Clear the graphics and empty the directions list
            routeLayer.removeAll();
            hiddenSegmentsLayer.removeAll();
            curDirections = new ArrayList<String>();
            mResults = null;

            // retrieve the user clicked location
            final Point loc = map.toMapPoint(x, y);

            // Show that the route is calculating
            dialog = ProgressDialog.show(RoutingSample.this, "",
                    "Calculating route...", true);
            // Spawn the request off in a new thread to keep UI responsive
            Thread t = new Thread() {

                @Override
                public void run() {
                    try {
                        // Start building up routing parameters
                        RouteParameters rp = mRouteTask
                                .retrieveDefaultRouteTaskParameters();
                        NAFeaturesAsFeature rfaf = new NAFeaturesAsFeature();
                        // Convert point to EGS (decimal degrees)
                        Point p = (Point) GeometryEngine.project(loc, wm,
                                egs);
                        // Create the stop points (start at our location, go
                        // to pressed location)
                        StopGraphic point1 = new StopGraphic(mLocation);
                        StopGraphic point2 = new StopGraphic(p);
                        rfaf.setFeatures(new Graphic[] { point1, point2 });
                        rfaf.setCompressedRequest(true);
                        rp.setStops(rfaf);
                        // Set the routing service output SR to our map
                        // service's SR
                        rp.setOutSpatialReference(wm);

                        // Solve the route and use the results to update UI
                        // when received
                        mResults = mRouteTask.solve(rp);
                        mHandler.post(mUpdateResults);
                    } catch (Exception e) {
                        Log.w(ESRI_EXCEPTION_TAG, e);
                        mException = e;
                        mHandler.post(mUpdateResults);
                    }
                }
            };
            // Start the operation
            t.start();
            return true;
        }

I get exception on the following line: mResults = mRouteTask.solve(rp);


texts: How to get WKT for various Spatial Reference Systems?

texts:
I need to provide WKTs of spatial reference systems in the APIs provided by GDAL/OGR.

Is there some specific place where I can look for WKTs of the spatial reference systems that I'm working with? Or is there some method/property in the SpatialReference class etc through which I can find the WKTs of different spatial reference systems?

Meta-info for people from non-geography/Computer Science background: All the three answers currently given below are good. I accepted the answer that let my code be self managed. I didn't have to hard-code the strings in my program and used the API itself. Also, beware of the harmless sound of "Well Known String". It sounds as if it's very small and easy to remember thing.


texts: QGIS Print Layout: how to create a drop-shadow for items

texts:
USing QGIS 3.4.4, I've added a map to a print layout, given it a black frame, and it looks fine.

Now how do I add a drop-shadow effect to the map frame in the layout?  I haven't found anything in the layout's properties that would create such an effect.

Searches through SE and Google return nothing.


texts:
I have a font called Univers 55 on my PC (Windows XP). I would like to
use this in MapInfo but it is unavailable in the font drop down.

Does anyone know how it would be possible to make this font available?


texts: Will Toshiba Satellite 70-A-11h meet GIS student notebook requirements?

texts:
I'm just about to start a college to study GIS and I need new notebook computer.
I would like a one that will last me for awhile and that can run the ArcGIS and ERDAS Imagine programmes that are provided for students without any problems.

One that I'm looking for at the moment is Toshiba Satellite 70-A-11h.

OS: Windows 8.1 64-bit (pre-installed)
Processor: 4th generation Intel® Core™ i5-4200M processor with Intel® Turbo Boost Technology 2.0
clock speed : 2.50 / 3.10 Turbo GHz
internal resolution : 1,600 x 900
Hard disk capacity: 1 TB
RAM: 8,192 (4,096 + 4,096) MB
DDR3L RAM (1,600 MHz)

Could anybody tell me whether this is a good starter laptop for a GIS student or are some of the specifications a definite no no?


texts: How to label a WMS layer from an Online Server, over which I do not have control?

texts:
I have discovered that the Western Australia Dept of Mines and Petroleum offers WMSs.

On adding these to ArcMap, however, I notice that they do not have labels. For example, this means one must use the identify tool to get the name of a petroleum permit under application. This is a bit dismaying, as I was hoping to use these WMSs in place of downloading the data manually once a month. Without labels in the WMS tiles, I find them less useful for making maps or putting them in ArcReader.

Is there a way to force the labels to appear?


texts: Exporting WMS Images/Tiles to our Area of Interest

texts:
Is there a way to clip WMS layers to our area of interest.

I have the following WMS layer that I want to clip for Polygon shown in Red.

I am getting the following error message if I try with SAGA Clip for Raster (and a similar message for GDAL).


texts: Is it possible to have presets for digitizing in QGIS?

texts:
I want to digitize many identical features (same attributes). They will have different location. Type: points and lines.
Is it possible to have presets? Like to select: "traffic calming" and then all the attributes of those presets apply, without me having to manually state which attributes that feature has.


texts: Cutting hole in raster using polygon in ArcGIS Desktop?

texts:
I have two layers: a layer with a raster and a layer with a polygon, I need to cut a polygon from a layer with a raster, how to do it?

It is necessary to make a straight hole, and not to create a new layer
not true:

just like this:


texts: How do I split subjacent lines and merge attributes in QGIS

texts:
I have 2 vector line layers. They are subjacent, so one of them is exactly on top of the other but the features have different nodes and attributes.

My goal is to create labels and descriptions for the features which contain attributes from both.
The idea is to create a third layer which is split up like the two existing ones and has the attributes from both.

So I want to merge both layers and the result layer should have all the nodes and all attributes.


texts: COUNTY WebService API lookup from valid street address

texts: I am looking for a solid WebService API that will allow me to submit an http request with a pre-validated US Street/City?state/Zip Address and return COUNTY in xml or json about 200 times per work day.  I am aware that Google, MapQuest & Bing do this however the response will go into an internal database, my use does not fit into their free Terms Of Service and I can not afford their large fee for my very small business.  It looks like TigerWeb may do it?  Is the data good enough?  What might a request look like? Many thanks in advance.


texts: Setting same custom Icon marker for various JSON layers

texts:
I am attempting to set the same icon for three diferent JSON layers on a leaflet API map, but it does not show the requested image. Here's the code
  function popupwindow(feature,layer){layer.bindPopup("
Site Name:"+feature.properties.NAME+"
");};
   var Placeicon = new L.icon ({ iconUrl: "Place.png", iconSize: [30, 40], iconAnchor: [15,40],});

    var placeLayer = L.geoJSON(Place,{onEachFeature: popupwindow}).addTo(map);
    var ArchSiteLayer = L.geoJSON(Arch_sites, {onEachFeature: popupwindow, icon: Placeicon}).addTo(map);
    var RockartLayer = L.geoJSON(Rockart_Sites,{onEachFeature: popupwindow, icon:Placeicon}).addTo(map);
    var WHsurveyLayer = L.geoJSON(WHsurvey,{onEachFeature: popupwindow, icon:Placeicon}).addTo(map);


texts: Is there a way to calculate the max width and length of a polygon or polygons? I'm currently working with roughly 10K+ building interior layouts. What I'm trying to do is generate and populate an SQL/Access database (only because it was requested) containing all of the data that I can pull from each floor plan/room. One of the requests that I received was to include the maximum length, width, and if available the height for each room within the data. I have performed various searches and have found solutions for calculating the average length/width, but I have yet to find a solution for calculating the maximum length/width.


texts:
I have a map scan (scale 1:500, CRS probably: ETRS89 / UTM Zone 33N) and want to georeference it.
Therefore, I set a ground map (Google Satellite, CRS: WGS 84/ Pseudo Mercator).
After georeferencing, the scaling of my map is incorrect. My area has grown from 1250 m² to 3000 m².
On the fly projecting is enabled and I also set the project CRS manually to Pseudo Mercator.

Does anyone have any idea of where I'm going wrong?


texts: what is the metadata link in geoserver layer definition for?

texts:
I`m adding some layers in geoserver and I noticed that there is a place to put a metadata link. It also says that it should be according to FGDC or tc211.

What can I put in this metadata link field? The url for the geonetwork metadada page? Or a xml file with the metadata?

Also, how can I use the information from that field i.e. query the metadata?


texts: using joinDelimiter with MergeRule "Join" (Python in ArcGIS 10.1)

texts:
In this example from ESRI, the MergeRule is set to "Mean" and the values from two fields from two different feature classes are averaged and written to a new field.

    # Set the merge rule to mean and then replace the old fieldmap in the mappings object
    # with the updated one
    fieldmap.MergeRule = "mean"
    fieldmappings.ReplaceFieldMap(fieldmappings.FindFieldMapIndex("POP1990"), fieldmap)

In the context of executing a Spatial Join (assuming I've already called my input and target feature classes' field maps), how would I rewrite this bit of code to set the MergeRule to "Join" multiple features' attributes of the same field into the same field in the output feature class using "; " as a delimiter?

So the attributes of FieldA of my target features' that intersect my target features all get written to FieldA in the output spatially joined feature class. For example, in the image below the purple feature (originally my target feature) in my output feature class would have FieldA = "brown; orange".


texts: Cannot upload an IMG file into PostGIS using raster2pgsql

texts:
I cannot upload into PostGIS a raster with the following code:

raster2pgsql -s 4326 -I -C -M "C:\lyr\gebco.img" -F public.gebco ¦ psql -d test -U postgres -W

It says ERROR: Unable to read raster file: public.gebco

Is it because of the sentence, or because of the configuration at my database? I don't know what to change.


texts: Visualizing overlapping polygons by occurence

texts:
I work in a library providing geospatial services and I have a patron with about 60 surveys with perceived accent regions in Mexico.  Individuals drew on maps where they think people speak with different accents in Mexico.  The end goal here is to have a map that combines the results of these surveys into one map.

Here is what one of the surveys looks like-

He's got them georeferenced and then digitized to individual feature classes in a geodatabase.  Now we've got polygons overlapping one another in different layers like so (I'm only showing 2 for simplicity).  Each polygon in the layer represents a different accent region

First feature class-

Second feature class-

Both classes layered on top of one another

How can I combine these 60 feature classes to make a map showing these perceived regions?  The end result as something like a heat map would be perfect.  Would that work very well with nominal data?  I've poked around online and haven't found much help.  I'm just struggling getting my head around visualizing the combination of all those layers.

I'm using ArcGIS 10.1 Build 3035.


texts: Which wavelengths are assigned to which bands in NAIP imagery?

texts:
I cannot seem to find a definitive source on which wavelengths are assigned to which bands for 4-band NAIP imagery.  Here is an example of the imagery I am working with (2011 4-band NAIP imagery).  I contacted the USDA FSA APFO Aerial Photography Field Office who then sent me a metadata file.  The only pertinent information in the metadata is as follows:

                Each sensor collected 11 image bands.

                PanF27A,PanF02A and PanB14A panchromatic bands with a

                spectral range of 465-676nm. RedN00a and RedB16a with a

                spectral range of 604-664nm. GrnN00a and GrnB16a with a

                spectral range of 533-587nm. BluN00a and BluB16a with a

                spectral range of 420-492nm and Near-infrared bands

                NirN00a and NirB16a with a spectral range of 833-920nm.

                The CCD arrays have a pixel size of 6.5 microns in a

                12000x1 format.

When analyzing the pixel brightness values for water, band 1 appears to be red due to lower pixel brightness values and band 3 appears to be blue due to high pixel brightness values and band 4 is definitely nIR due to very low pixel brightness values.

Is there a definitive source to support or reject my assumptions on which bands are which?


texts: Is it possible to check incoming GeoJSON to see if any of the features are identical to existing ones before adding to map?

texts:
I am working on a Rails/PostGIS app and doing a typical ajax call to retrieve GeoJSON within the map viewport bounds. Whenever the map is shifted or zoomed all of the markers are removed and then added again according to the new bounds. The problem I have with this is that it creates a flicker effect, as well as closes popups(especially annoying when a marker is close to the bounds and readjusts them when the popup opens, closing it immediately). I am wondering if there is a standard approach to filtering out duplicate features. This way nonidentical markers can simply be added to the GeoJSON layer instead of recreating the entire layer each time, and  existing markers that are now outside of the bounds can be removed. I am having a hard time looking for examples as I am not familiar enough with Javascript to write a solution. I had originally been using Google Maps API but switched to Leaflet hoping it would be easier to figure out. http://labs.easyblog.it/maps/leaflet-layerjson/ is an example of the ideal behavior, but I had a hard time trying to implement this with GeoJSON.

The code:

var geojsonLayer;

var addGeoJSONLayer = function(geoJSON) {

if(geojsonLayer) {
  geojsonLayer.clearLayers();
}

geojsonLayer = new L.GeoJSON(geoJSON, {
    onEachFeature: function(feature, layer){
        layer.bindPopup("" + feature.properties.name + "");
        }

}).addTo(map);

geojsonLayer.addData(geoJSON);

};

$.getJSON('/summits.geojson/?bbox=' + map.getBounds().toBBoxString() + '', addGeoJSONLayer);

map.on('moveend', function(event){
    if(map.getZoom() >= 10) {
        $.getJSON('/summits.geojson/?bbox=' + map.getBounds().toBBoxString() + '', addGeoJSONLayer);
    }
});

I have also used the leaflet-ajax plugin hoping it would solve this, but it produces the same results as above. I know it has a "refilter" method but I am not sure how to use it, or if it can even be used to solve the problem. Any help whatsoever would be greatly appreciated!


texts: QGIS Polygon edge style based on adjoining feature?

texts:
Is there a way to change the style of only PART of a polygon's border in QGIS? I would like one or two edges of certain polygons to render a different color, or not at all, depending on the type of feature that is adjacent. (For example, a political division that adjoins a waterbody would show that one edge as blue.)

The obvious way seems to be changing the style of the adjoining feature, then using symbol levels to have it render on top of the first feature, but this doesn't work; there is always a little bit of the other border showing through underneath:

I can increase the line thickness of the adjoining feature so that it fully covers the feature underneath (in the example image it's already twice as thick), but then it also begins to cover the interior of that polygon. I can also convert to polylines and just clip off the shoreline, but then I lose the geometry. I think what I really need is a way to suppress rendering of the border on the one side, and just covering it with something else isn't working.


texts: ArcGIS - Eliminating slivers/gaps automatically

texts:
I have a land map with three labels (sand, vegetation and water).
I wish to eliminate overlaps and gaps between these labels. There are tens of thousands of gaps and overlaps, so I need to automate this process. I know how to do this for overlaps using ArcGIS tools but not for gaps.
For overlaps, I detect the intersect between the 3 layers (sand, vegetation and water) using the intersect tool and then re-label the intersect using a simple calculation (the intersect is re-labeled to whichever layer has the highest value for that space).
However, for gaps, I'm struggling to figure out how to eliminate the slivers via an automated approach. I've tried to create a topology to identify gaps and then use the eliminate tool to remove these slivers. Although the topology identifies gaps, I can't run the eliminate tool to remove the gaps as it requires "a selection". I don't know how to select gaps as this data is non-existent.
How can I eliminate the gaps detected by my topology? I can't do this manually because it's tens of thousands of gaps. I also can't seem to do this using the eliminate tool as I can't "select" the gaps as there is literally no vector data due to it being a gap.
Data details:
A feature class with 3 polygon types (sand, vegetation and water).


texts: Symbology issue with feature class limited by domain

texts:
I added a field to a feature class in order to maintain symbology from the original KML file (this is a new question following up on this one).  The new field is limited to three options by a domain.

When I go to symbolize based on this field, all values are considered to be  as opposed to being separated into their appropriate category.  Does this have to do with being controled by a coded domain or is something else going on here?


texts: I have created a map with polygon shapefiles and am trying to import them onto an different raster but when I do they are larger than the raster image and are far away. What am I doing wrong? My intention is to overlap the shapefiles to show different terrain because I am dealing with wetlands and ecosystems.


texts:
I have a polygon dataset that I am symbolizing in OpenLayers using a context to determine the correct color, and also a label for each polygon that I want to alter depending on the zoom level.

But although my polygons get colored as they should, my labels don't change. If I test this with a point feature and no symbolization, my labels do change the way I want. So I guess this is something to do with the way rules and context are applied? How can I fix this so that the labels change size with the rules?

var ratingStyle = new OpenLayers.StyleMap({
        "default": new OpenLayers.Style({
            fillColor: "${getColor}",
            strokeColor: "#000000",
            fillOpacity: 0.7,
            graphicZIndex: 1,
            label: "${ADMINUNIT}",
            labelAlign: 'cm',
            labelOutlineColor: "white",
            labelOutlineWidth: 3,
            fontSize: 12,
            fontOpacity: 1
        }, {
            context: { //this is for the polygon color
                getColor: function (feature) {
                    return feature.attributes.RATING == 'NotRated' ? 'transparent' :
                    feature.attributes.RATING == 'Low' ? 'green' :
                    feature.attributes.RATING == 'Moderate' ? 'yellow' :
                    feature.attributes.RATING == 'High' ? 'red' :
                    feature.attributes.RATING == 'Extreme' ? 'black' :
                    'grey';
                }
            }
        }, { //rules for labels?
            rules: [
                new OpenLayers.Rule({
                    minScaleDenominator: 50000000,
                    symbolizer: {
                        fontSize: "0px"
                    }
                }),
                new OpenLayers.Rule({
                    maxScaleDenominator: 50000000,
                    minScaleDenominator: 20000000,
                    symbolizer: {
                        fontSize: "10px"
                    }
                }),
                new OpenLayers.Rule({
                    maxScaleDenominator: 20000000,
                    symbolizer: {
                        fontSize: "12px"
                    }
                })
            ]
        }),
        "select": new OpenLayers.Style({
            fillOpacity: 1,
            graphicZIndex: 1
        })
    }, {
        extendDefault: true
    });


texts: arcmap ExportFrame on FocusMap inconsistency

texts:
I have an issue where the ExportFrame would use the extent instead of the full extent after right clicking on arcmap and selected "Full extent".

Sometime it will use the ExportFrame of the full extent, sometime i will be the ExportFrame of the extent

This is two case where it should be similar, it is not consistent ;

this would be the proper one

this would be the incorrect one

code used(before this code is called, I'm doing a right click on the map and selecting "full extent");

IActiveView docActiveView = (IActiveView)ArcMap.Document.FocusMap;
docActiveView.Refresh();
var exportRECT = docActiveView.ExportFrame;
var pPixelBoundsEnv = new Envelope();

var bmp = new Bitmap(exportRECT.right, exportRECT.bottom);
var myGraphics = Graphics.FromImage(bmp);

pPixelBoundsEnv.PutCoords(0, 0, 0, 0);
myGraphics.Clear(System.Drawing.Color.Aqua);
docActiveView.Output((int)myGraphics.GetHdc(), 96, ref exportRECT, (IEnvelope)pPixelBoundsEnv, null);
myGraphics.ReleaseHdc();

bmp.Save(@"....");

Why do i get a inconsistency in this case?

edit #1

to remove the manual click on arcmap to reset to full extent, i added this before the code above but the behavior describe previously still happen at random time.

var uidFullExtent = new UID();

//esriArcMapUI.FullExtentCommand
uidFullExtent.Value = "{0830FB35-7EE6-11D0-87EC-080009EC732A}";
uidFullExtent.SubType = 3;
IMxDocument doc = (IMxDocument)ArcMap.Document;
ArcMap.Application.Document.CommandBars.Find(uidFullExtent).Execute();
//uncommenting this line make it seem to always produce the first screenshot (my expected behavior)
//ArcMap.Application.Document.CommandBars.Find(uidFullExtent).Execute();

why calling the command twice would seem to fix my issue?

edit #2

this is (in my opinion) an ugly fix but seem to work...

private void fixBound()
{
    var uidFullExtent = new UID();

    //esriArcMapUI.FullExtentCommand
    uidFullExtent.Value = "{0830FB35-7EE6-11D0-87EC-080009EC732A}";
    uidFullExtent.SubType = 3;

    IActiveView docActiveView = (IActiveView)ArcMap.Document.FocusMap;

    do
    {
        var fullEnvelope = docActiveView.FullExtent.Envelope;
        var boundEnvelope = docActiveView.ScreenDisplay.DisplayTransformation.ConstrainedBounds.Envelope;

        bool same =
            fullEnvelope.YMin == boundEnvelope.YMin &&
            fullEnvelope.YMax == boundEnvelope.YMax &&
            fullEnvelope.XMin == boundEnvelope.XMin &&
            fullEnvelope.XMax == boundEnvelope.XMax;

        if (!same)
            ArcMap.Application.Document.CommandBars.Find(uidFullExtent).Execute();
        else
            break;

    }
    while (true);
}

is there a better way of getting what i'm expecting?


texts: Snapping polygons while reshaping edges?

texts:
I have two Polygons, A and B, in two shapefiles.

Is there any automatic way to reshape the edge of Polygon A according to the edge of Polygon B?


texts:
I am creating a map that contains some layers, all defined in an array called basemapsArray

var map = new ol.Map({
    layers: basemapsArray,
    controls : ol.control.defaults({
        zoom : false
    }),
    target: 'map',
    ...

The layers need to be defined when the map is created, but none should be loaded right away; the user needs to pick one by clicking a checkbox first.

How would I go about not displaying any layers when the application loads?

I know I can loop through them and use .setVisible(), but perhaps there is a more elegant way?


texts:
In QGIS I'm using the geometry generator to visualize a point shape file as a line with the simple code:

And then I'm doing a graduated styling according to the burial value of those points:

So the end result looks like this:

Now I want to upload this to the GeoServer and use the same styling. But the SLD export of QGIS doesn't support the geometry generator. I can't find any documentation to write this SLD myself. I'm not even sure it's possible in a SLD file. If not, does anybody know a work-around? Maybe exporting the generated line as a line shapefile?


texts: When designing geodatabases I have followed industry standards and used text and numeric fields.  Some people have different ways of designing geodatabases and only use text fields.  What are the schools of thought on text vs. numeric fields?  Why would you use a text field when it is always a numeric value?


texts: Editing Point Data Layer made from Database Table using ArcGIS Pro?

texts:
I have a project in ArcGIS Pro which is connected to a SQL Server Database. I made a point feature layer from one of the tables however I cannot add points to the layer. I connected to the database using the account which I created the database in, so I am the database owner, and the tables are loading correctly however when I make a feature layer using the tables, I cannot edit the layer.

EDIT: By a point feature layer, I added the table that contained the fields I would wish to be able to populate in my database to the map. From there I highlighted the map layer, selected "Add Data" and chose "XY Point Data" from the drop down menu (this is in the "Layer" group from the Map menu in the ribbon).

This newly created layer I imported into my database sde, however if I want to add points to this layer, I cannot. I get the message:

  This enterprise database table is not registered with the Geodatabase. Edits cannot be made.

The problem is I cannot "register" the table because the option is greyed out under the "Manage" option when I right-click the database table. I also noticed that the "Priveleges" winddow indicates to me that I am not the data owner, eventhough I'm using the same account in the Data Source as I did when I made the database, an account that is also the database administrator. I also named the schema the same as the admin user because I read that that can be a problem.

How do I configure the database so that it recognizes my user as the data owner?


texts:
I have several shapefiles that depict the geology of an area.
I'm having a hard time to match the colors for the common geological formations of these shapefiles.
Can you please guide me?
I can do it manually but it will take forever.


texts: QGIS 2.18.13-- the plug in manager only displays 16 possible downloadable plug ins

texts:
This, of course, can't be. The biggest and most pressing one is the processing plugin-- I can't access any of the vector processing tools.
I recently upgraded to 2.18.13, which was released only a few days ago, can that be the issue?


texts: CMV Layers widget loads only intermittently

texts:
Without any code changes, the contents of the Layers widget, my layer tree hierarchy, loads sometimes, and other times does not load.

It usually works on the first load of the page, then may fail to load on refreshes.  Clearing the cache seems like it helps sometimes.

The behavior is so inconsistent, it is really difficult to diagnose.

It is an internal application, so I can't share.

Has this ever been encountered before?


texts: Copying file geodatabase on ftp site to local disk using Python?

texts:
There is a file geodatabase sitting on an ftp site that I would like to download with a Python script. Right now I'm thinking one way to do this is to copy the ftp geodatabase to a geodatabase on my computer. Below is the script I've started. Does anyone know how I can alter this script so that I obtain ftp gdb? Thank you

Below is my final, working code as based on the answer @om_hennners provided.

import arcpy, os, sys
from arcpy import env
arcpy.env.overwriteOutput = True
from ftplib import FTP

directory = "/group/geodb" #location of gdb on ftp
folder = "D:\\temp\\"
out_gdb = "data.gdb"
out_path = folder + os.sep + out_gdb
copy_gdb = "hydro.gdb" # This is the gdb I would like to copy from the ftp  site
ftp = FTP("10.4.2.22")
ftp.login("user", "pass")

ftp.cwd(os.path.join(directory, copy_gdb))
print "Changed to " + os.path.join(directory, copy_gdb)

filenames = ftp.nlst()
print filenames

print "starting to write"
for f in filenames:
    with open(os.path.join(out_path, f), 'wb') as local_file:
    ftp.retrbinary('RETR '+ f, local_file.write)

ftp.close()
print "closed ftp connection"


texts: Bug of QGIS when using "multipart to singlepart"?

texts:
I used yesterday, in QGIS 3.2.3 the tool to convert multiline to a single line ("multipart to single part").

I chose the option of the command "multipart to single part" the geometry feature (line) and marked z dimensions. QGIS save right the temporary layer in format shape, a shapefile with z dimension included.

When I tried to eliminate z dimension with ogr2ogr and inserted in QGIS, the program consider that the layer is a single line geometry. Who can help me?


texts:
I have problems with Merge tool. I can't find the output file in ArcCatalog even though I refresh it. Output is shown in Results window but nothign happens if I click Add to display. Strangely, also Messages->View is empty but Inputs and Environments seems normal. I'm trying to merge shapefiles and these are in the same coordinate system and located in the same folder. I've also copied the folder where I have the files to be merged to a new location but it didn't help.

I saw ther was a similar question earlier but it has been closed, see https://gis.stackexchange.com/questions/182104/merge-success-but-can-not-find-and-display-in-arcmap


texts: Path format for intermediate data while sharing models

texts:
I didn't fully understand using relative paths in models yet. I have already asked a question on this topic (EDIT3 - summary: I always check "Store relative path names", but when I move the model, this often/ always uncheck and I don't know why), and now I'm trying a more concrete approach. In this help page sharing whole directories was suggested. Now I try to do this - I have created similar directory structure and set scratch workspace (in ArcToolbox - Environments, not per model).

Now I face a problem: what path should the intermediate data have? When I left it blank, the result was ERROR 000735 for tools using the intermediate data as input or output, regardless of whether the data were managed or not.

Another way suggested here was to use %scratchworkspace% variable substitute. Now the errors are not so uniform, but none of my models work.  Most errors were caused by a typo in scratch workspace variable (thanks to @danb for finding this). Still, errors some other models (in functions converting shp to raster) last : ERROR 999999: Error executing function. Can't save to disk (check for space, write permission, or name).
Again, being managed or not means no difference.

One of the models previously failing due to the miss-spelled variable now works when the scratch workspace is a folder but not when it is a geodatabase. The error message is as follows:

ERROR 000875: Output raster: d:\Fav\APA\Lidar\ArcheoLidar\Scratch.gdb\FilterRaster's workspace is an invalid output workspace.
ERROR 000581: Invalid parameters.
Failed to execute (Focal Statistics).

I'm almost sure that the scratch workspace can't be blocked by anything. There could be problems with folder/geodatabase scratch workspace, but I tried both options and the errors are the same.

So how to share my model in the "ZIP and share well-organized system folder" manner? There must be some solution/ workaround for these problems.


texts: Installing QGIS3 on Ubuntu 16.04 Xenial: dependency problem

texts:
I am trying to install QGIS3 on my Ubuntu 16.04 Xenial.

Following the instructions on the QGIS Website I added the following lines to my sources.list:

deb https://qgis.org/ubuntugis xenial main
deb-src https://qgis.org/ubuntugis xenial main

I run

sudo apt-get update

and try to execute the installation:

sudo apt-get install qgis python-qgis qgis-plugin-grass

For each of the packages I get the answer that there are several missing packages:

python-qgis : Depends: python-qgis-common (= 1:3.0.0+24xenial-ubuntugis) but it is not going to be installed
           Depends: libqgispython3.0.0 but it is not going to be installed
           Depends: libqgis-analysis3.0.0 but it is not going to be installed
           Depends: libqgis-core3.0.0 but it is not going to be installed
           Depends: libqgis-gui3.0.0 but it is not going to be installed
           Depends: libqgis-server3.0.0 but it is not going to be installed
 qgis : Depends: gdal-abi-2-2-2 but it is not installable
    Depends: libgdal20 (>= 1.8.0) but it is not installable
    Depends: libqgis-analysis3.0.0 but it is not going to be installed
    Depends: libqgis-app3.0.0 but it is not going to be installed
    Depends: libqgis-core3.0.0 but it is not going to be installed
    Depends: libqgis-gui3.0.0 but it is not going to be installed
    Depends: qgis-providers (= 1:3.0.0+24xenial-ubuntugis) but it is not going to be installed
 qgis-plugin-grass : Depends: qgis-provider-grass (= 1:3.0.0+24xenial-ubuntugis) but it is not going to be installed
                 Depends: libgdal20 (>= 1.8.0) but it is not installable
                 Depends: libqgis-app3.0.0 but it is not going to be installed
                 Depends: libqgis-core3.0.0 but it is not going to be installed
                 Depends: libqgis-gui3.0.0 but it is not going to be installed
                 Depends: libqgisgrass7-3.0.0 but it is not going to be installed
                 Depends: grass740 but it is not installable

Most interesting is that some packages are not installable: gdal-abi-2-2-2, libgdal20, grass740

Any idea how to solve this?


texts: Unable to read raster into R: 'TIFFReadDirectory:Failed to read directory at offset'

texts:
I'm getting a weird error when trying to read a raster into R.

>r <- raster('myraster.tif')
Error in .local(.Object, ...) :
  TIFFReadDirectory:Failed to read directory at offset 2606110

Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer",  :
  Cannot create a RasterLayer object from this file.

It is definitely reading from the correct location, as when I try to read in something that does not exist, I get a completely different error:

> r <- raster('thisrasterdoesnotexist.tif')
Error in .local(.Object, ...) :
  `C:\Users\Documents\thisrasterdoesnotexist.tif' does not exist in the file system,
and is not recognised as a supported dataset name.

Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer",  :
  Cannot create a RasterLayer object from this file. (file does not exist)

I was reading and writing rasters from this directory just a few minutes ago. I've tried restarting R and my computer without success.

So the rasters that are doing this are ones that I recently downloaded using the function download.file(). Other rasters are reading in fine.  When I used download.file() I did it with just arguments url and output filename. Am I missing something about how do download tiffs from the internet?

Also, my session info:

> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] rgdal_0.9-1   raster_2.3-24 sp_1.1-0

loaded via a namespace (and not attached):
[1] grid_3.1.1      lattice_0.20-29 ncdf_1.6.8      tools_3.1.1


texts: gdalwarp with DSM as DEM leaves shifted pixels in their original unshifted location

texts:
I'm trying to account for building parallax differences between images collected at different viewing angles. When I use a DSM created from VRICON data as my DEM source, I notice that building roof pixels are properly shifted to the correct location; however, they're also left in their original un-shifted position.  Does anyone know if there is a way to replace the original location of these pixels to no-data?

This is how I am calling gdalwarp.
gdalwarp -to RPC_DEM=vriconfile -co COMPRESS=LZW -co INTERLEAVE=BAND -co TILED=YES -co BIGTIFF=YES -rpc -et 0 -overwrite -wo WRITE_FLUSH=YES -wo OPTIMIZE_SIZE=YES -multi -r near -dstnodata 0 -wm 1024 -of GTIFF -t_srs EPSG:4326 infile outfile

Example images attached.


texts: How add correct coordinates to map in WGS 1984

texts:
My map format is WGS 1984. How insert data in wgs1984? At now its inserted incorrect coordinates
xy = (47.550976, 42.963041)

array = arcpy.Array()
with arcpy.da.InsertCursor(schetchiki_path,['SHAPE@XY', 'Name']) as c:
    c.insertRow([xy,name])


texts:
I kept my original question clear and concise to make it easier to answer.  This is a response to requests for more information.

Introduction
I am using QGIS version 2.18.9. I created about 20 new memory layers by clicking on "Layer", then "Create Layer", then "New Memory Layer".  I want to create 8 duplicates of each layer.

Aim
I want to avoid creating from scratch multiple layers containing identically-shaped polygons.  I want to create duplicates so I can simply change the colour of each polygon to represent different data.

Problems
When I right click on a layer and then click "Duplicate" I get an error message saying "Memory Layer type unsupported"

What I have tried
As above.  I have not found anything else on the program that looks promising.  I have not found any topics on here that help.  My knowledge is limited and I am not familiar with all the jargon or protocols.


texts: arcpy for loop to save shapefiles as .layer files

texts:
I have 150 shapefiles in folder in "D:\ss3\polygons".
I want to save each polygon as .layer file with the polygon name in "D:\ss3\layers"

However, Python displays: "Parsing error SyntaxError: invalid syntax (line 3). I am really confused.

Does anyone have any idea how to fix the SyntaxError and if my code is correct?

import arcpy

#folder locations
in_polygon_folder = "D:\ss3\polygons"
out_layer_folder = "D:\ss3\layers"
arcpy.env.workspace = in_polygon_folder
in_polygon_folder = arcpy.ListFeatureClasses("*", "ALL")

for polygon in in_polygon_folder:
...     polygon_name = polygon[:-4]
...     polygon_name = in_polygon_folder+"\\"polygon_name+"plg.shp"
...     out_layer_folder = out_layer_folder+"\\"+polygon_name+"layer.lyr"
...     arcpy.MakeFeatureLayer_management("buf_layer", out_layer_folder, "256", "NONE", "NOMAINTAIN_EXTENT")

Againg I apologize for my mistake.
My code (I include) works well, however, without the for loop I have write 150 lines to save each polygon shp as .lyr file. This my code:

    import arcpy
    from arcpy import env
    env.workspace = r"D:\ss3\polygons"
    buf= r"D:\ss3\polygons\00.shp"
    ou2= r"D:\ss3\layers\002.lyr"

    arcpy.MakeFeatureLayer_management(buf, 'buf_layer')
    arcpy.SaveToLayerFile_management('buf_layer', ou2, "ABSOLUTE")

What I am trying to do is to include my code into a for loop.


texts:
Is there an updated pGRouting tutorial to this:

https://anitagraser.com/2013/07/06/pgrouting-2-0-for-windows-quick-guide/

Trying to following it using QGIS 2.14.0 Essen +  PostgreSql 9.5 (pgAdmin III) but can't get it to produce the query output result route, in fact there is not result from running the query (0 rows)


texts: GDAL raster attribute table not opening on python3.6 and GDAL 2.1.3

texts:
This is related to the question at Different results from GDAL raster attribute table command on mac and windows

Now, I am not able to get the raster attribute table of the same file: https://www.dropbox.com/s/fmomfpro3j6dmz8/Shift_cult_past_current_prediction_20160107_gr1DD.tif?dl=0 on windows. I am using python 3.6 and gdal version 2.1.3. The code is as follows:

import gdal
dataset = gdal.Open(dataset_uri) # dataset_uri is path to .tif file
band = dataset.GetRasterBand(1)
rat = band.GetDefaultRAT()

--EDIT:

how to get the raster attribute table usingpython 3.6 and gdal 2.1.3


texts:
I'm trying to use hdf4 raster image in QGis 1.8. This image come from the MODIS satellite. I've loaded the file, it appears on the layer window bu it is impossible to see it on the display window.

Did someone already work with hdf images on QGis?

Thanks


texts: Make layer with TileStache from MySQL database

texts:
I am unsuccessful in attempt to make layer with TileStache whitch gets data from MySQL. I found simple MySQL table structure (http://howto-use-mysql-spatial-ext.blogspot.com/):

create table Points (
name VARCHAR(20) PRIMARY KEY,
location Point NOT NULL,
description VARCHAR(200),
SPATIAL INDEX(location)
);

and then

INSERT INTO Points (name, location) VALUES ( 'point1' , GeomFromText( ' POINT(31.5 42.2) ' ) )

For TileStache in tilestache.cfg I got:

"data":
    {
        "provider": {"name": "vector", "driver": "MySQL",
                     "parameters": {"dbname": "gis", "port": "3306",
                     "user": "root", "password": "root",
                     "table" : "points"}}
    },

When I go to http://localhost:8080/data/ I get in console:

  GET http://localhost:8080/data/10/167/395.png 500 (Internal Server
  Error);
  GET http://localhost:8080/data/null 400 (Bad Request).

Same internal error when going to http://localhost:8080/data/0/0/0.geojson

NOTE: http://localhost:8080/osm/ works fine.

I think problem is global, because I tried making layer from .json file, but same result


texts: What would a map of the world look like if lat/longs were treated as projected coordinates?

texts:
I'm not quite sure if I'm phrasing this right. It's just occurred to me that lat/longs are two dimensional coordinates like any other projected coordinate system, so it's presumably possible to create a two dimensional map based on these unprojected coordinates.

It would obviously be centred on the point (0,0) (off the west coast of Africa, on the equator), and the 180 meridian would be exactly on the left and right borders.

Is there a name for this kind of "non-projection"? Presumably there are images of it, but I'm just not sure what to look for.


texts: Trigger (before update) not working. It works in a local PostGIS installation with same table structure and data

texts:
A before insert/update trigger on one of my CartoDB tables is not being raised. Same trigger is working in a local installation of PostGIS.

This is my source table. And here, the trigger's code:

CREATE OR REPLACE FUNCTION update_geom_column()
RETURNS trigger AS
$BODY$
DECLARE
  coords_array varchar[] := ARRAY[2];
BEGIN
  if new.map_url is null then
    raise exception 'map_url cannot be null';
  end if;

  -- Get coords using regexp_matches
  select regexp_matches(NEW.map_url, 'center=(-?[\d]*\.[\d]*),(-?[\d]*\.[\d]*)&') into coords_array;
  NEW.the_geom = CDB_LatLng(coords_array[1]::numeric, coords_array[2]::numeric);

  return NEW;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;

drop trigger if exists update_geom_column_trigger on foursquare_checkins;
CREATE TRIGGER update_geom_column_trigger
BEFORE INSERT OR UPDATE
ON foursquare_checkins
FOR EACH ROW
EXECUTE PROCEDURE update_geom_column();

Every time there's a new insertion in my CartoDB table, all geometry fields of all rows are set to null. But the same trigger is working in my local PostGIS.

May it be something related with CartoDB itself?


texts:
I have planet.osm imported into a database. Now I am trying to set up hourly updates.

I generated a file changes.osc.gz using osmosis. This file contains updates for 1 hour - which seem to be running EXTREMELY slow. I should add out of desperation I am now using an Amazon machine with 16 processors and 122 GB of memory - with everything running off internal SSD drives (not EBS volumes)

I then try to append these changes using osm2pgsql using the following command:

osm2pgsql --append -s -H db.host -d osm -U user -C 64000 --number-processes 16 --cache-strategy dense --hstore --hstore-add-index -K -G -W -p osm --extra-attributes -v changes.osc.gz

The options I used are the same as the ones used for the initial import.

I get stats like this:

Processing: Node(120k 0.4k/s) Way(15k 0.17k/s) Relation(431 3.65/s)  parse time: 521s

This looks extremely slow - but then the situation gets worse... overall I waited more than 1 hour and the process was nowhere near finished.

Then pending ways are about 32 million.. is this normal for an hourly update?

I really hope I am doing something very wrong. Does anyone have a setup that is feasible with updates? What parameters are you guys using?

Does anyone know if it is even possible to keep an OSM database with updates?


texts:
I need to create a mapping app with C# and stumbled upon MapWinGIS which looks like an appropriate tool. I have a minimal app working, pulling tiles from OpenStreetMap.

I want to plot a point on the map. I thought it would be as easy as calling DrawPoint(), but it's not working:

AxMap.DrawPoint(-100, 32, 10, Convert.ToUInt32(ColorTranslator.ToOle(Color.Red)));

Instead of drawing a point at map long (32, -100), the point appears to be at lat/lon of (0, 0).

Here's the full function:

public Form1()
        {
            InitializeComponent();

            AxMap.CursorMode = tkCursorMode.cmPan;
            AxMap.InertiaOnPanning = tkCustomState.csFalse;
            AxMap.Projection = tkMapProjection.PROJECTION_GOOGLE_MERCATOR;
            AxMap.TileProvider = tkTileProvider.OpenHumanitarianMap;
            AxMap.KnownExtents = tkKnownExtents.keUSA;

            int d = AxMap.NewDrawing(tkDrawReferenceList.dlSpatiallyReferencedList);
            AxMap.DrawPoint(-100, 32, 10, Convert.ToUInt32(ColorTranslator.ToOle(Color.Red)));

        }

What am I doing wrong?


texts: Do I need JTS Topology Suite if I use PostGIS?

texts: They seem to overlap in functionality, so if I only use PostGIS and Postgres SQL, do I miss anything important from JTS Topology Suite?


texts:
I am creating a QgsVectorLayer in a plugin and loading it into the map. I would like to set the labelling parameters while I'm doing that. I've followed several examples found here and here, but my labels aren't being displayed. When I go to the labelling tool none of the settings are as I've specified.

def finalize(self):
    self.vl.commitChanges()
    self.vl.updateExtents()
    QgsMapLayerRegistry.instance().addMapLayer(self.vl)
    self.setDisplayProperties()

def setDisplayProperties(self):
    palyr = QgsPalLayerSettings()
    palyr.readFromLayer(self.vl)
    palyr.enabled = True       #this works
    palyr.fieldName = 'label'  #this works
    palyr.placement = QgsPalLayerSettings.OverPoint  #??
    palyr.placementFlags = palyr.placementFlags or QgsPalLayerSettings(BelowLine)    # not working
    palyr.fontSizeInMapUnits = False
    palyr.textFont.setPointSize(4.6)  #results in 4 - seems to be integer only
    palyr.textColor = QColor(68,92,249) #this works
    palyr.writeToLayer(self.vl)

I've tried calling setDisplayProperties at every slot in the finalize procedure with the same result every time.  I've also tried with and without various settings.


texts: calculate specific rows and populate their result in another field

texts:
I'm working on ArcGIS 10 desktop version. I have a file with one entity entered multiple times (rows) and each time that has been given a new value against it. I want to sum the values against this entity and populate it in the new field against same entity. As given in the screenshot, A, BB, BE, C etc needs to be sum separately.

VB Script and python within field calculator will also work for me.


texts:
I have been struggling to get python setup to do some image processing, so I really need the http://www.gdal.org/ GDAL libraries installed on CentOS 6.5. I want to install the package in a local folder (maybe /workspace/GDAL) without root access. When I try to build from source, it seems CentOS is missing a bunch of libraries.

I will be using it for opening HDF4, HDF4-EOS files, and have a local installation of the HDF4/HDF5 libraries (say /workspace/HDF).

If I can install a binary without root, is there a way to point GDAL to these libraries?


texts: Averaging attributes from small line segments into a new line segment

texts: I'm working on a project which involves combining shorter road line segments into longer ones where needed using ArcGIS 10.5. Each segment has an attribute of average traffic flow. For example, there may be four segments less than 100 feet long that have different values for traffic flow, I want to combine these into one segment that has the average traffic flow of the four segments. I'm looking for a way to automate this process so that manual calculations wouldn't need to be done.


texts: What are the differences between these two options in satellite image  metadata?


texts: Correcting for correlation of kernel density of events to that of their distance from separate feature using ArcGIS Desktop?

texts:
I have a kernel density raster of recorded events. These events are correlated to their distance from a linear feature. In other words, density is higher near this line because it is a 'starting point' and the events dissipate as they get further away. I want to account for this so as to measure a density independent of distance, so I can effectively compare the raster to other features in the landscape.

I am using ArcGIS Desktop 10.


texts: Colour a vector file based on colour data in a field

texts:
I have a geological units shapefile which has colour data in a field, in which the colour data relates to an associated text and will help in clarifying which unit is which down the line.
An example is:
"BASECOLOUR" !FIELD NAME
"40, 15, 5, 0" !FIELD DATA

I assume these are CMYK values?

So, how can I do it?
Can I build a rule-based expression which uses the field to define the CMYK values?


texts: Zoom to Shapefile attribute table row feature

texts:
I am working with the python code below in ArcGIS to zoom into a shapefile's attribute table row features without selected until the end of table one by one.

I am trying to use this code but this one requires that a row is selected.

import arcpy

mxd = arcpy.mapping.MapDocument('CURRENT')

df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]

df.zoomToSelectedFeatures()

arcpy.RefreshActiveView()

Lets say, I have mapindex shapefile which has a 10 record in the attribute table. I want to zoom into first row automatically, then save the ArcMap .mxd or export as pdf. then move to next row, and do the same process(zoom in, save and export) until the end of record(row 10) in mapindex's attribute table.


texts: Polygon Neighbors not found in Proximity Toolset of ArcGIS Desktop 10.0?

texts:
I cannot find the Polygon Neighbors tool. I have searched for it as I usually do and I have also browsed the proximity toolset but it is not there. The other Tools, e.g. Buffer and Near are there and work fine.
Here is a screenshot:


texts: How to read SQL request result executed with Python OGR?

texts:
I'm trying to manage certain operations depending on PostGIS version and schema.

To get PostGIS version and schemas list, I'm used to execute SQL statements, respectively:

SELECT PostGIS_full_version();
SELECT nspname FROM pg_catalog.pg_namespace;

So I'm trying to get the same information using Python GDAL:

# Python 2.7.12 and GDAL 2.1.3
conn_settings = "PG: host={} port={} dbname={} user={} password={}"\
                .format(host, port, db_name, user, password)

conn = ogr.Open(str(conn_settings))

# prepare SQL requests
sql_version = str("SELECT PostGIS_full_version();")
sql_schemas = str("select nspname from pg_catalog.pg_namespace;")

# executing SQL
pg_version = conn.ExecuteSQL(sql_version)
pg_schemas = conn.ExecuteSQL(sql_schemas)

print(pg_version)
>>> <osgeo.ogr.Layer; proxy of <Swig Object of type 'OGRLayerShadow *' at 0x08A54C08> >

print(type(pg_version))
>>> <class 'osgeo.ogr.Layer'>

print(dir(pg_version))
>>> ['AlterFieldDefn', 'Clip', 'CommitTransaction', 'CreateFeature', 'CreateField', 'CreateFields', 'CreateGeomField', 'DeleteFeature', 'DeleteField', 'Dereference', 'Erase', 'FindFieldIndex', 'GetDescription', 'GetExtent', 'GetFIDColumn', 'GetFeature', 'GetFeatureCount', 'GetFeaturesRead', 'GetGeomType', 'GetGeometryColumn', 'GetLayerDefn', 'GetMetadata', 'GetMetadataDomainList', 'GetMetadataItem', 'GetMetadata_Dict', 'GetMetadata_List', 'GetName', 'GetNextFeature', 'GetRefCount', 'GetSpatialFilter', 'GetSpatialRef', 'GetStyleTable', 'Identity', 'Intersection', 'Reference', 'ReorderField', 'ReorderFields', 'ResetReading', 'RollbackTransaction', 'SetAttributeFilter', 'SetDescription', 'SetFeature', 'SetIgnoredFields', 'SetMetadata', 'SetMetadataItem', 'SetNextByIndex', 'SetSpatialFilter', 'SetSpatialFilterRect', 'SetStyleTable', 'StartTransaction', 'SymDifference', 'SyncToDisk', 'TestCapability', 'Union', 'Update', '__bool__', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__len__', '__module__', '__new__', '__nonzero__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'next', 'schema', 'this', 'thisown']

print(pg_version.GetMetadata_Dict())
>>> {}

Is it possible to get SQL result as a string object (or dict...)?


texts: ArcGIS Field Calculator returning 0 values when decimals are expected?

texts:
I realize I posed this question, and got answers, several days ago (see Field calculator error) , but none seem to really be working, and so am posing again.

Below are two screenshots that show the fields with field properties, and another showing the field calculator and the equation with the "answer" field populated by 0s. I apologize for them not being next to each other or in line with the appropriate text, but the web formatting keeps overlaying them.

Here is an overview of the problem: I am trying to do a in field calculator, where I'm trying to populate a new field with the values from a fairly simple equation of one field divided by another (Cnt1 by Pop1 in this case).

Both fields that I am dividing are double, and the value, while small is not infinitesimal, approx 0.01765.

I have tried creating various types of new fields: double, long, float, and played around with the scale/precision/properties, but everytime it returns "0" values. I know the values will be very small, i.e .04 but it doesn't seem to be a decimal display problem as I tried running it with Pop1/.4 and it correctly returned a decimal.

I've tested dividing the Cnt1 by .5 and that gives an appropriate decimal value, so it's not the new field format; the one thing that seems really strange is when I add (in field calculator python version): !Cnt1!+!Pop1! (which is 38+218699) I get 2.187, however, I suppose this could be related to the field being classified as float with precision=4, scale=3?

I've also tried the suggestions of @blord-castillo of doing:

1.0* (Cnt1/Pop1)

and also
    1.0* (int(Cnt1/Pop1))
But neither works, I'm at my wits end on this one, and would greatly appreciate any help!


texts:
I am using version 3.0.12 , I have made an XML file and I am using Arial Black and Arial Bold fonts but mapnik was not rendering those fonts. So , I changed the fonts to DejaVu Sans Book and then all my labels are showing up .
Why is it so, since Arial Black and Arial Bold are very common fonts?


texts: Why does my QGIS WMS Server work only when Ignore GetMap/GetTile and GeoFeature Info are checked?

texts:
I am creating an API that runs between QGIS and my GeoServer that includes Basic Authentication which is read by the API that confirms if that user has an account with us. I can load the majority of the layers when:

Ignore GetMap/GetTile URI reported in capabilities
Ignore GetFeatureInfo URI reported in capabilities

are both checked.

When they are not both checked, the layer doesn't load and I get a pop-up asking for the GeoServer realm credentials.

I can load layers from the GeoServer from OpenLayers just fine which uses Basic Authentication. So I feel that the problem lies within QGIS.

What part of the QGIS authentication may be the cause of this issue?


texts: GDAL 2.2.2 Checking all NoData Values in a directory of tifs are the same?

texts:
How do I check if all the NoData Values of my rasters (.tif) are the same in a directory in a python script/command line/bash using ubuntu?

I am using Ubuntu 16.4 LTS and using the Terminal Command Line to look at and edit rasters.

These rasters will be processed and the area with values will eventually be polgonized, the NoData values will need to be the same therefore I need to check them.

Also my NoData Values for each individual tif files are not showing up as a raster band, they are embedded in the file itself;


texts: Display house numbers on the street corners

texts:
I have a street map (MuliLineString geom and house numbers min and max, left and right).

I would like to show this numbers on the street corners. I use GeoServer.

If I use the TextSymbolizer with LinePlacement the label is in the middle of the line.
If I use it with Geometry (startPoint and endPoint function) I can't move it in parallel. (All the labels are at the same point.)

Have you any idea?

Thanks


texts: How to calculate the shortest path between two points characterized by latitude and longitude with pgrouting?

texts: I have to calculate the length of the shortest path between A (lat1, long1) and B (lat2, long2). But all the solutions I've found do not get a correct result because they only calculate the distance between the nearest vertex of A to the nearest vertex of B.


texts: Reclassifying Landcover Raster in ENVI 5.3?

texts:
I have produced landcover raster using Landsat 8 OLI, Pansharpened image. The derived landcover classified image is placed below:

Now, I am intending to reclassify this image to change its class values (1,2,3...) in accordance with my ranking values. Secondly, resampling will also be required to change its pixel size from 15x15 to 30x30m resolution.

I have searched ENVI 5.3 tools but didn't find such options which are although available in ArcGIS. Can any one suggest me how I can edit and save class values and resample pixel size in ENVI 5.3?


texts: How to get smooth contours from points or IDW raster in QGIS

texts:
Hello I'm an artist trying different ways of drawing contours in QGIS using points with income values. I've been able to import a shp file with the data, create a layer with centroids of the census blocks and create contours using the contours plugin but they're not smooth.
So then I tried creating the contours from an IDW raster but couldn't get the contours to work using extraction->contour.
How can I make the contours using extraction->contour? How can I make them smooth? I'm trying to create a 10 layer contour map of income in NYC which is accurate and smooth. What's the best way to do this in QGIS without GRASS (had issues using it in QGIS) and SAGA (had issues installing on OSX)?


texts: Add spaces to attribute cells when edit record

texts:
I generate a shapefile from postgresql's postgis table (I used django pyshp library). My shapefile looks valid, it was successfully opened with ArcGIS 10.1, 10.2, 10.3. But I have a problem: If I save edits of a point's coordinates or edit an attribute table, a space symbol appears at the start of the attribute cells. I can edit only one cell, and every cell in every object has started with a space. So the last symbols are migrated to the next cell if cell's size is not enough. So values become wrong and I am unable to use the data.

But I can save my original shapefile as new layer and then open it as a new shapefile. And when I do that, I can edit all I need and all cells stay valid.

Why? What can be wrong with my original shapefile? And why would saving it as a new shapefile fix the problem?

Update: When I try to edit something using QGIS, all objects stay valid and the same issue does not occur.

Now I add the python-2.7 code creating shapefile: full code is too long

import zipfile
import shapefile as sh
...
self.sh = sh.Writer(hash_geom[self.geometry])
...
# create a dbf fields list: (name, type, length), default type = C
field_type = FIELDTYPE.get(field.get_internal_type())
if field_type == 'N' or field_type == 'F':
    self.sh.field(str(key), field_type, lengthOfData, 8)
elif field_type == 'L':
    self.sh.field(str(key), 'L', 1)
else:
    self.sh.field(str(key), field_type, lengthOfData, 0)
...
    # for every record I append value to values list:
    self.records.append(str(field.value_to_string(obj)))
...
# then I append full record as new object attributes:
self.sh.record(*self.records)
...
# then I append geometry
if self.geometry in ['POINT', 'MULTIPOINT']:
        p1, p2 = self.coords
        self.sh.point(p1, p2)
 elif self.geometry in ['POLYGON', 'MULTIPOLYGON']:
        self.sh.poly(parts=self.coords)
...
# then I create a shapefile as zip from stream of records:
from StringIO import StringIO
stream = StringIO()
self.shp = StringIO()
self.shx = StringIO()
self.dbf = StringIO()
self.sh.saveShp(self.shp)
self.sh.saveShx(self.shx)
self.sh.saveDbf(self.dbf)
z = zipfile.ZipFile(stream, 'w', zipfile.ZIP_DEFLATED)
z.writestr(self.modelname + '.shp', self.shp.getvalue())
z.writestr(self.modelname + '.shx', self.shx.getvalue())
z.writestr(self.modelname + '.dbf', self.dbf.getvalue())
z.writestr(self.modelname + '.prj', 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]]')
z.close()


texts: How to allow users to publish data in their workspace?

texts:
How can I set up the GeoSever security so that users associated with a given role/group can register and publish their data (e.g. PostGIS) as GeoServer layers?

I can register things as admin. I tried to allow other users to do this and set up a multi-user system following Opengeo documentation. But in the system I got, the new user, e.g. private_editor only has the Layer Preview option in the Data section, as if not logged in.

How can I grant access to the non-admin user other options in the Data, such as Layers, Stores, Styles, and Layer Groups? Which documentation should I be looking into for such settings?


texts:
I am trying to rasterize a GeoJSON or shapely geometry but it does not rasterize all the geometry (some of it is not in the TIFF-file).

I tried gdal_rasterize -burn 255 -burn 0 -burn 0 -ts 4950 4900 src destination and also tried the rasterize function from rasterio. None of it is working.

Can someone explain how to get all the shapes in the raster?


texts: Get Geometric Attribute Columns to Dynamically Update in QGIS

texts:
I want to add X Y columns to my point data shapefile. There are various ways to add them as explained here https://www.northrivergeographic.com/qgis-adding-x-y-coordinate.
But none of these methods add a column that dynamically updates X Y values when a point location is changed. What I want to know is that is there any way to have geometric columns in QGIS ( X, Y, Length, Area) update dynamically?


texts: Optimize computation distance of million points to lines in Python

texts:
I have found questions here of how to compute the distance of a point to a line (manually, with distance method of some libraries...) but my problem is that I need to compute the distance of 4M points to 9K lines, and keep points that are closer than a specific distance.  I'm doing it with Python 3.5

    for i in range(len(multip)): #Shapely Multipoint object
        while j < len(network): # .shp file opened GeoDataFrame object from geopandas
            dist = network[j].distance(multip[i])
            print('dist', dist)
            if (dist <= critdist):
                count += 1
                xxx = (multip[i].x)
                yyy = (multip[i].y)
                distlist = np.append(distlist, dist)
                critcoordx = np.append(critcoordx, xxx)
                critcoordy = np.append(critcoordx, yyy)
                j = 0
                break
            j += 1
        j = 0

I couldn't come up with a solution to vectorize this process.

I also tried things like:

network.distance(multip)

But it does not compute individual distances.


texts:
I have a valid and existent workspace (file geodatabase) in a specific folder.

    [TestMethod]
    public void WorkspaceHandler_TestConstructor_FileGdbWorkspace()
    {
        workHandler = new WorkspaceHandler(gdbWorkspace);

        IWorkspace workspace = workHandler.GetCurrentWorkspace;

        Assert.AreEqual(gdbWorkspace, workspace.PathName);
        Assert.AreEqual(esriWorkspaceType.esriLocalDatabaseWorkspace, workspace.Type);
        Assert.AreEqual(false, workspace.IsDirectory());
        Assert.AreEqual(true, workspace.Exists());
    }

My last assert fails. All the other ones are working OK.

Is there any sort of specificity on this particular method?


texts: Orthorectification errors in ArcMap when including RPC data

texts:
I am trying to orthorectify satellite imagery with a DEM in ArcMap. I have already georeferenced the raster.

The imagery came with an RPC TXT file, but when I change the name of the RPC file to match the new, georeferenced raster image (by adding a "1"), the tile is completely shifted and partly clipped when I use the "Create Ortho Corrected Raster Dataset" tool.

Original file name: *******0004.tif
New file name:      *******00041.tif (I added the "1" to RPC file to match this).

Do I have bad RPC data?


texts: Converting labels to points using ArcGIS Desktop?

texts:
is there a way to convert labels, created by Maplex labeling engine to point features?

In MapInfo and CAD software, it's possible to convert labels to points. Those point features include a text and a rotation for this point. When text is horizontal, it includes all the text. When the text is curved, it included one char for each point with the rotation in degrees. That makes it possible to use the labels in other software or store them in a database.

ArcGIS 10 only allows to convert labels to annotations, which result in polygons.


texts: Subsetting multiple rasters with multiple shapefiles using Python

texts:
I want to subset multiple raster files with multiple shapefiles and the following code is working (it is not the whole code, only the part for the subsetting).
I am using Python 3.6.8
i_shp = 0  # iterate over .shp-files
while i_shp < len(shp_list):
    with fiona.open(shp_list[i_shp], "r") as shapefile:
        shapes = [feature["geometry"] for feature in shapefile]

        i_ras = 0  # iterate over raster files
        while i_ras < len(raster_list):
            for scene in raster_list:
                with rasterio.open(raster_list[i_ras], "r") as src:
                    out_image, out_transform = rasterio.mask.mask(src, shapes, crop=True)
                    out_meta = src.meta

                    out_meta.update({"driver": "GTiff",
                                     "height": out_image.shape[1],
                                     "width": out_image.shape[2],
                                     "transform": out_transform})

                    with rasterio.open(
                            str(outpath) + raster_names[i_ras] + str(shp_names[i_shp]) + str(ras_extension[1:])
                            , "w", **out_meta) as dest:
                        dest.write(out_image)
                i_ras = i_ras + 1
    i_shp = i_shp + 1

I`ve got 7 rasters and 2 shapefiles and after I run the code I have 14 subsets.
But I want to place this code inside a function but then it's not working correctly. I just get 7 subsets (only from the first shapefile in my shp_list).
I think that the while-loop isn't working correctly, but I cannot figure out why.
def subs(shp_list, shp_names, raster_list, raster_names, outpath):
    # subsetting all raster files with all .shp-files
    i_shp = 0  # iterate over .shp-files
    while i_shp < len(shp_list):
        with fiona.open(shp_list[i_shp], "r") as shapefile:
            shapes = [feature["geometry"] for feature in shapefile]

            i_ras = 0  # iterate over raster files
            while i_ras < len(raster_list):
                for scene in raster_list:
                    with rasterio.open(raster_list[i_ras], "r") as src:
                        out_image, out_transform = rasterio.mask.mask(src, shapes, crop=True)
                        out_meta = src.meta

                        out_meta.update({"driver": "GTiff",
                                         "height": out_image.shape[1],
                                         "width": out_image.shape[2],
                                         "transform": out_transform})

                        with rasterio.open(
                                str(outpath) + raster_names[i_ras] + str(shp_names[i_shp]) + str(ras_extension[1:])
                                , "w", **out_meta) as dest:
                            dest.write(out_image)
                    i_ras = i_ras + 1
        i_shp = i_shp + 1

        # number of created subsets
        subset_count = i_shp * i_ras
        if len(shp_list) * len(raster_list) == subset_count:
            (str("Done. \n ") + str(subset_count) + str(" subsets created"))

        return print(str("Done. \n ") + str(subset_count) + str(" subsets created"))


texts: How to configure IIS for arcgis mobile maps for ArcGis server 10

texts:
I am having this problem- after enabling security for GIS services, i can't view my maps created for android, in mobile content. I used windows domain users. I can connect to GIS connection, i also can see my published maps, but opening it gives me an error: "The map failed to load.".
After enabling security i also couldn't see my published services in web map, error about the tokens. Then i found some information about that. Setting ArcGISApplicationsAppPool Identity to "NetworkService", and setting all applications (KML, Manager, Mobile etc.) to use this application pool, got my web page going, requesting login, and after successful login i see my data.

So i was wondering, maybe my mobile map has something to do with IIS configuration also, because login is successful. I converted mobile folder in "Default web site" to application, and set same application pool, but seems its not enough.


texts: Getting Field value for a given coordinate out of ESRI Shapefile using GDAL/OGR

texts:
I have a bunch of ESRI shapefiles that contain Land Cover data across Canada (provided by Geobase). I need to query the files and obtain the value of a certain field (called COVTYPE) in a given location specified either by lat/lon or UTM coordinates. I can open a file in Quantum GIS and find the needed values manually, but this process needs to be done automatically for a large number of values so I'm using C++ and GDAL.

I'm very new to the whole GIS area and I'm just starting to learn GDAL. So far I've learned how to loop over layers, features, fields etc, but I can't figure out how to relate coordinates to features. I went through the official GDAL/OGR tutorials, but I'm still stuck. Any pointers would be appreciated!

Update:
Just to clarify. My input data would be coordinates (lat/lon or UTM). So the way I imagine this should work is:

I find which feature the given point is located within
read the field value in that feature

I know how to do step 2, but I'm stuck at step 1.

Final solution
Technically, the update to Ragi's answer comes very close to what I need to do, but I'll post here a quick summary of how I ended up using it. My way is easier for constructing a point geometry object.

So leaving all the boilerplate code out, the essential part is:

OGRPoint* point = new OGRPoint(some_longitude, some_latitude);
layer->SetSpatialFilter(point); //getting only the feature intercepting the point
OGRFeature* feature = layer->GetNextFeature();
int value = feature->GetFieldAsInteger(0); //getting the value - DONE!
//in my case it's 1st field, hence the 0th index


texts: How can I show distance indicators along a line feature in QGIS?

texts: I am preparing a map of a 120 km long walking trail in QGIS 2.18 for publication (printing). I have a shapefile (line feature) showing the walking trail. I want to be able to show distance indicators along the trail route at 2km intervals i.e. how far a certain point is from the start & finish of the walking trail. Is there a geoprocessing tool or plugin that I can use to do this?