texts: How to reproject arbitrary coordinate system grid to OSGB using FME?

texts:
I have a polygon grid of a certain shape that has some data associated with it. Unfortunately its not properly projected, being in what seems to be an arbitrary scale and coordinate system (it was originally a DXF). I need to reproject this.

The grid cells are about 8 * 11 "units" (I'm going to guess metres - it looks like a "projected" system). I need them to be 3000 * 4000 metres (OSGB).

How do I reproject this grid into the desired new grid? Once its been "resized", I can then easily offset it to georeference it properly.

I have access to FME.


texts:
Has anyone successfully implemented pgr_fromAtoB function?

Sometimes I get 0 results from points in the same line string, sometimes I do get results,

How can accuracy be improved?, or maybe do I need to normalize my data?


texts: Merge GeoWebCache generated tiles from one server with tiles from another server

texts:
I have a set of tiles (millions) generated by the builtin GWC in GeoServer 2.1.2 which is stored on server A.
I would like to copy all the tiles to server B containing GeoServer 2.1.3 and the corresponding builtin GWC. Server B already contains a completely different set of tiles and we want both tile sets to coexist.

Copying the tile_folder in data_dir/gwc and the workspace seems easy enough, but are there other things we need to consider and is it at all possible to copy generated GWC tiles from one server to another?

I have tried and it doesn't seem to work. So before I dig into the xml configurations, server versions and so on, I would like to know if it is possible at all?


texts: Adding own data to ArcGIS.com javascript template and hosting locally

texts: ArcGIS.com has a basic viewer javascript template where you can create a map using ArcGIS.com and then download the files/template to be hosted locally.  I won't be able to upload my data to ArcGIS.com so I want to know how hard it is to add my data to the template to be hosted locally.  I currently have the template downloaded and hosted locally with an ArcGIS.com basemap.  I would like to add my own ArcGIS Server map services to it.


texts:
Does anyone know of a way to convert GEDCOM files to KML?

I am building a family tree and I would like to be able to upload the infromation I have gathered to Google Earth.

I already tried to use GedGenie but it didn't work.


texts: QGIS OpenLayers Plugin - Question about Google Maps/Earth Policy

texts:
I am operating on OS X version 10.9.5 using QGIS 2.6.1 - Brighton. I am using the OpenLayers Plugin version 1.3.6 (Google maps) to create shapefiles and edit existing shapefiles over the Google map plugin data. I happened notice that in the Google Maps/Earth Permissions page under "Geo Permissions" a FAQ was posed:

http://www.google.com/permissions/geoguidelines.html

"I'd like to trace a map using your imagery. Can I?" The response: "You may not use Google Maps or Google Earth as the basis for tracing your own maps or other geographic content."

My question: Does QGIS have some sort of agreement with Google Maps/Earth which allow the mapping community to use the plugin they have provided? Can anyone assist?


texts: Deciding how many random sampling points needed for specific area?

texts: I have a study area (forest) around 25he. I would like to randomly have sampling points (center of the sampling plots) there. How many points (plots) I need in related to the area of my case study? is there any rule for calculating the number of the random points?


texts: Exporting ArcGIS Metadata to HTML with thumbnail?

texts:
I’m trying to export metadata as a pdf using ArcMap v10.6.1, but am unable to export it with the thumbnail. The output has "Thumbnail is not available." (see screenshot below). Would you know how to make it so the html output includes the thumbnail?

My workflow is as follows:

Create metadata using the ISO 19139 Metadata Implementation Specification style.
Run the XSLT Transformation tool using this metadata as the Source Metadata and the ISO19139.xslt file as the Input XLST. Save the Output as a .html file in a folder on my desktop.

Reference: Exporting ArcGIS Metadata as PDF using ArcPy?.


texts: Activate tracking for ArcGIS Online with python

texts:
It is possible to update data in ArcGIS Online by python-script:
http://blogs.esri.com/esri/arcgis/2014/01/24/updating-your-hosted-feature-service-for-10-2/

Configuration is done by changing the sddraft, which is structured as a tree. In the draft there is no 'editorTrackingInfo'-element as well as no subelements. So they have to be added. I tried this by doing:

a=ET.SubElement( prop, “editorTrackingInfo” )
b1=ET.SubElement(a, “enableEditorTracking” )
b1.text=”true”

As a result the XML is extended:

<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>WebCapabilities</Key>
   <Value xsi:type="xs:string">Query,Create,Update,Delete,Uploads,Editing,Extract,Sync</Value>
   <editorTrackingInfo>
     <enableEditorTracking>true</enableEditorTracking>
                <enableOwnershipAccessControl>true</enableOwnershipAccessControl>
                <allowOthersToUpdate>true</allowOthersToUpdate>
                <allowOthersToDelete>true</allowOthersToDelete>
   </editorTrackingInfo>
</PropertySetProperty>

I upload the Service Definition. Unfortunately in ArcGIS Online the tracking is not activated. Could you help?


texts: Converting a drawn map into vector tiles

texts:
I am looking into how to turn a fantasy map into vector tiles so it can imported into something like Mapbox but I'm getting drowned in information and I can't find the start point in the process, what software is needed (best fit for purpose) and if it's even feasible without a massive amount of work.
So, if you had created a fantasy world and mapped it out, how would you go about turning it into something that could used by ArcGIS or Mapbox?
Is an image even a good starting point? Should I be looking at GeoJSON or something similar? Do I need to add a cartographic system to it so it has actual coordinates (I'm guessing that is required) and if yes, how?
I'm a programmer by trade so using APIs and various schemas won't be a problem, I'm just not well versed in the world of cartography and maps.


texts: Batch clip returning a single raster only

texts:
I am trying to use a batch clip over a few of my raster layers in ArcGIS. After inputting the multiple layers, I receive only a single output image corresponding to one of the input files. I checked the inputs before pressing OK. No error messages after as well. The application just clips one and then leaves it.
What do I do?


texts: Is there a hotkey for switching on/off a layer in QGIS

texts: I would like to know if there is a hotkey in qgis for switching on/off a layer. I have a task where I have to open and close a layer quite frequently. Doing it by a mouse is too time-consuming and annoying when you have got to do it over and over again. If there is no hotkey for that is there a way to define a hotkey(some python script maybe?).


texts: Weird Error when setting the source path in the "PICTURE_ELEMENT"

texts:
I am trying to set the sourceImage to a tiff file using this code:

        m=1
        pic = arcpy.mapping.ListLayoutElements(mxd,"PICTURE_ELEMENT" , str(m))[0]
        pic.sourceImage = r"D:\PDF\tables\{0}.tiff".format(str(m)) ##error here

I get this error: IOError: Cannot set path based on current settings.


texts: Change style of GeoJSON features in Leaflet after it is done loading

texts:
Using Leaflet.js, I am loading a GeoJSON (containing many polygons) with the AJAX plugin (https://github.com/calvinmetcalf/leaflet-ajax), to which I pass a styling function. However, I would like to reapply colours to each feature after the whole GeoJSON is done loading. For this, I use a poly.on('data:loaded', function() {}, but I can't figure out how to make it work in Leaflet. Here's my code, how can I restyle my features after there are done loading?

function getColor(d) {
    return parseFloat(d) > 150000 ? '#800026' :
            parseFloat(d) < 150000  ? '#BD0026';
}

function style(feature) {
    return {
        weight: .5,
        opacity: 1,
        color: 'white',
        dashArray: '3',
        fillOpacity: 0.7,
        fillColor: 'white')
    };
}

function style2(feature) {
    return {
        weight: .5,
        opacity: 1,
        color: 'white',
        dashArray: '3',
        fillOpacity: 0.7,
        fillColor: getColor(feature.properties['var'])
    };
}

var poly = new L.GeoJSON.AJAX('polygons.geojson', {style: style});
    poly.addTo(map);

poly.on('data:loaded', function() {
    poly.resetStyle(style2);
})


texts: Return result of pgr_dijkstra() in pgrouting 2.2

texts:
I am testing pgr_dijkstra() in pgrouting 2.2, but got columns (seq, id1, id2, cost) in the return result rather than columns (seq, path_seq, node, edge, cost, agg_cost) as described in the pgrouting 2.2 manual. This result is more like that described in the pgrouting 2.0 manual. Any ideas as to why this is happening?

I am using the following configurations under Windows, and this test is for one-to-one routing only:

[('PostgreSQL 9.5.2, compiled by Visual C++ build 1800, 64-bit',
  'POSTGIS="2.2.2 r14797" GEOS="3.5.0-CAPI-1.9.0 r4090" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.0.2, released 2016/01/26" LIBXML="2.7.8" LIBJSON="0.12" RASTER',
  '(2.2.2,pgrouting-2.2.2,544044b,master,1.59.0)')]


texts: Problem with intersecting lines over a polygon layer in QGIS

texts:
I have a shapefile with lines (a road network) and I want to intersect it over a polygon layer in order to finally have a polygon layer (each cell has an ID number) with the intersected lines for each ID.

The shapefile with lines has pollutant emission values (CO etc) (in grams). Before the intersection I calculate a new value (value/$length).
See the image (for the selected line CO=6662940.61gr):

In the intersected file, in order to calculate the new total value C (in grams) for each grid cell, I sum up the values e.g. CO of each grid cell and multiply with the new length containing in each grid cell. The final result is not correct. I get a higher or lower value  in the intersected file comparing to the original one. See the following images For the corresponding line (within two grid cells) I get CO=1568950+4724202=6293153.12gr):

For the whole grid the difference is much higher, I get almost the double values for the intersected file.

I do the following:

Any idea of what could be wrong? Is it right to perform this kind of intersection when working with lines or not?


texts: Change detection between two binary images

texts:
Is there a scientifically-valid to use raster calculator to subtract two binary images (0, 1) to get the difference between Pre- and Post flood events?

In pseudo-code:

Difference "change detection" = Post-event flood event (1,0) - Pre-event flood event (1,0)

I tried it and got difference map, but I want to make sure it is valid method.

There are 4 possible cases:

recorded flood events in the post- and pre-images and the result would be (1-1=0), 2
flood event in the post-image and no flood in the pre-image, and the result would be (1-0=1),
non-flood in the post-image and flood in the pre-image, and the result would be (0-1=-1),
non-flood in both post-and pre-images, so the result would be (0-0=0).

The main concern around the interpretation of the third case.


texts: Selecting only features with multiple parts in QGIS 3.14

texts:
I have a multipart polygon layer that resides on a PostGIS server. The layer is a parcel map, with each parcel having a single unique PIN. Most of the features are single parts, but some are two or more parts for various historical reasons. There are close to 40,000 features. If I check geometries for multipart geometries with only a single part, it returns all of my single part features. For small numbers of parcels I can use this tool to show these errors in the attribute table, invert the selection, and I have the parcels I am looking for. However, QGIS chokes when I try doing this with the full layer, and I really want to avoid having to do this in little bites when I'm sure there is a better way.
I want to select all the parcels that have more than one part. If I look at the Identify Results panel, the (derived) group shows the number of parts in that feature. This is the attribute I am looking for. How is this calculated, and how can I use this derived value as my criteria for a selection, or is there another way?


texts: QGIS script for filling fields in attribute table

texts:
I want to write a script that will fill field values in the attribute table the following way:

There are dots with attributes and lines I am creating. I want the script to use the field value of the dots, which a created line is snapped on and fill a field in attribute table of the line based on the values of the dot.

I want to put the referent to be the dot (so from attribute table of the dot should be taken the data) and the line to be target (to the attribute table of the line where should the data be puten).

I have dots that are snapped on  lines. I want value from attribute field  named as HP in the attribute table on every dot that is snapped to every line to copy to attribute field HPcount in the attribute table of every line. This is how it looks the real situation in QGIS.


texts: Seeking conferences for Spatial/GIS developers?

texts:
What are good conferences for GIS and spatial developers to attend?

For Esri desktop users I think the User Conference is a must attend, but if you are an Esri developer I think the Esri developer conference is a better event.

If you can't make the big shows then the regional events are also a really good deal.

FOSS4G is great when it is in your neighborhood.


texts: How to map Albers projection raster in Basemap of python?

texts:
I confused the setting of Basemap about Alers projection. I want to plot a province area of Nation to pcolormesh. the value of lat_0 and lon_0 is Nation map's center longitude and latitude or this province map's center and origin lat?

driver=gdal.GetDriverByName('GTiff')
driver.Register()
file0=r'I:\extract\temp\m2000041.tif'
ds=gdal.Open(file0,gdal.GA_ReadOnly)
band=ds.GetRasterBand(1)
arr=band.ReadAsArray()
gt=ds.GetGeoTransform()
proj=ds.GetProjection
xres = gt[1]
yres = gt[5]

# get the edge coordinates and add half the resolution
# to go to center coordinates
xmin = gt[0] + xres * 0.5
xmax = gt[0] + (xres * ds.RasterXSize) - xres * 0.5
ymin = gt[3] + (yres * ds.RasterYSize) + yres * 0.5
ymax = gt[3] + yres * 0.5

ds = None
width = xmax - xmin + xres
height = ymax - ymin - yres

lllon, lllat, urlon, urlat = gt[0], ymin - 0.5 * yres, xmax + 0.5 * xres,  ymax - 0.5 * yres
xl, yl = np.arange(lllon,urlon,xres), np.arange(urlat,lllat,yres)

false_easting = 4000000                 #False easting
xm,ym = np.meshgrid(xl-false_easting,yl)
arr2 = arr
arr2[arr2==-32767]=0                 #exclude nodata value

fig = plt.figure()
plt.title("The Plot")
m = Basemap(width = width,height = height,projection = 'aea',lat_1 = 25,lat_2 = 47,lon_0 = 105,lat_0 = 0,resolution = 'c')  # set the Albers paraller lat1,lat2, central lon and lat origin of Nation map.
lonl,latl = m(xm,ym)

m.pcolormesh(lonl,latl, arr2)
plt.show()

This code output a blank plot. I doubt the coordiantion meshgrid is wrong.
How to plot the Albers map? Would you give a example?


texts: I would like to ask anyone out there who knows of a good free website that allows me to upload my gis data files to co-worker. Each project I am working on are quite large and would need to upload 1 GB each.


texts:
I´m using qgis 3.16 and have the folowing Problem:
If i´m in the primary Window the scale on the bottom of the scrren shows me a correct value, but if i switch into the Printlayout mode the value of scale is wrong and about 10 times higher. I added to my project a shapefile and a few maps to work with.
So far i didn´t tryed anything because i´m quite lost. I read in another article that it might help to change the CRS, but i have no idea where to do it. How to fix the wrong scale?
In the picture you can see the scale bar shows 3750km which is wrong, it must be about 700 meters.


texts:
I'm currently building a project that will involve using raster imagery in the field on a Windows tablet with QGIS/Intramaps Roam and haven't been able to get a satisfactory understanding of a few questions about raster imagery.

The data I'm using comes from MassGIS and is in small tiles in jpeg2000 format. I'm using about 500 tiles. In order to use the data, I need to do two things:

Re-project the data to WGS84
Mosaic the tiles to form a single seamless image.

There seems to be two ways to do this, one very fast the other very slow. The first is to build a virtual raster tile (vrt) and then use gdalwarp to project to another vrt. Very fast. The second is to build a vrt and then use gdalwarp (or raster project in ArcGIS) to output a new jpeg2000 raster. Very slow.

Since storage space is not really an issue, my question is, which of these will perform better in the field and why? It seems like a vrt that is simply projected from another vrt is more like doing an OTF projection and would thus be slower than a jpeg2000 raster, but I haven't confirmed this anywhere.

If this sounds incredibly dense and there is something better than both these options, please share!


texts: Multiparts to singleparts to error - QGIS

texts:
I work with this polygon and I try to use the vector tool "Singleparts to Multipart" in order to expload the layer to  multipart, so I can select each part seperatly.

I don't care if the features in the attribute table has the same value. All I want is exploded layer:

and I get this error:

"At Least two features must contain the same attribute value"

I read Producing singlepart featureclass with unique IDs for each spatially non-connected polygon? ,but didn't get an answer


texts: Displaying answer to simple mathematical equation in ModelBuilder?

texts:
I have built a model where I am calculating the carbon sequestration rates of a particular forest type in a chosen county in mainland GB. The equation for this is tco2 x years x hectares.

I have constructed my model whereby my selected county and its forest cover (hectares) is multiplied by the carbon sequestration rate (of the chosen forest type) and then multiplied by years using the 'times' tool in the math raster tool box.

The model runs, however, I don't know how to check if the multiplications are right?

Is there a way to produce a table where I can summarize this and see the answer to the multiplication?


texts: Making county-level shapefile from set of points at 30 x30 km spacing using ArcGIS for Desktop?

texts:
I have a data set in csv form, like:

latitude, longitude, value
-45, 45, 10
....

I would like to calculate county level means from these data, using either ArcGIS or R+grass.

I have the ArcGIS USA Counties layer, but I have not been able to successfully complete a spatial join.

How can I do this?


texts: Finding the average value from polygon areas in a fishnet cell

texts:
I am looking to assign depth values to each fishnet grid cell that I have by taking the area-weighted average of values from a contour/isopach map.

The map was interpolating using the depths of individual wells using the Geostatistical Analysis tool Inverse Distance Weighting.

Attached see a picture of my example along with the attribute table.

At first I thought that Zonal Statistics as Table tool would be perfect but it would require me to convert to raster first (or even change the output of the IDW tool) but I have read that the conversion to raster is a poor choice (Does IDW interpolation in ArcGIS Geostatistical analyst work as exact interpolation method?). Is there a better method?


texts: sorted ItemFileReadStore list not pushed to dropdown menu // Dojo, ArcGIS

texts:
this may be more a Dojo question than ArcGIS, but I am not sure if the Javascript API is related to this issue.

I am trying to alphabetically sort a Dojo store and show these items in a dropdown list, based on this example: http://dojotoolkit.org/reference-guide/1.8/dojo/data/ItemFileReadStore.html

I can see in Firebug that my list is being sorted, but the sorted list is not displayed in the dropdown menu; the items there are still sorted by ObjectID.
I am not sure if I need to run my 'set' function differently, or if I am missing some code to replace the store list with the newly sorted list...ideas? // Jason

code:

    var dataItems = {
        identifier: 'name',
        label: 'name',
        items: values,

    };

var menuStore = new dojo.data.ItemFileReadStore({ data: dataItems });
menuStore.comparatorMap = {};

menuStore.comparatorMap['name']=function(a,b){
    if(a<b) return -1;
    if(a>b) return 1;
    return 0;
};

 var sortAttributes = [{attribute: "name", ascending: true}];
function completed(items, findResult){
    for(var i = 0; i < items.length; i++)
    {
        var value = menuStore.getValue(items[i], "name");
        console.log("Item ID: [" + menuStore.getValue(items[i], "name"));
        //// this console statement produces a sorted list in Firebug ////
    }

}
function error(errData, request){
    console.log("Failed in sorting data.");
}

menuStore.fetch({onComplete: completed, onError: error, sort: sortAttributes});
//  dijit.byId("schoolMenu").store = menuStore;   // may need this if an older version of API is used

  dijit.byId("schoolMenu").set ("store", menuStore); // schoolMenu is dropdown menu
} // end function


texts: Multi-Spectral High Resolution Satellite images for flood events

texts:
I'm searching for multi-spectral high resolution satellite images for flood events.
I found a database of flood events from this link with dates and approxiamte locations (polygons) and I used the Sentinel API hub to download images. The problem is that images are too large and cannot found the intresting regions and cannot get images of the exact same location for two different dates. (to compare pre and post events).
Is there a way to get a free dataset of high resolution satellite images for **flood events (pre and post disater)?
BTW, I want to apply machine learning algorithms on  these images.


texts: Merging Popups with Relationship Queries using ArcGIS API for JavaScript?

texts:
I am trying to merge two ArcGIS JS API examples: Feature Layer with Popup and Query Related Records. The idea I have in mind is clicking on a country feature, retrieve all related records from a service (already prepared for relationship queries) and present those text records inside a Popup (esri.dijit.Popup).

I was interested in doing this exercise, because I like the way this Popup presents multiple results for a feature, by paging them as you can see in the first link when clicking on a tree. And it was a good match for my application with Relationship Queries. So far, I have most of the functionality already prepared and I can see the related records retrieved from the services in my firebug console. Good news.

My problem comes when I have to put those records in the Dojo Popup: The example shows that adding features to the Popup is as "simple" as using the setFeatures(features) method. This method receives either an array of Deferreds or an array of Features. In my case, I have both of them available.

I get the results like this and add it to the popup on map.infoWindow parameter:

mydeferred = featureLayer.queryRelatedFeatures(relatedTopsQuery, function(relatedRecords) {
var fset = relatedRecords[res.attributes['OBJECTID']];
var items = dojo.map(fset.features, function(feature) {
    feature.attributes.DateStart = Date(feature.attributes.DateStart).toLocaleString();
    feature.attributes.DateEnd = Date(feature.attributes.DateEnd).toLocaleString();
    feature.setGeometry(evt.mapPoint);
    return feature.attributes;
});

map.infoWindow.setFeatures(fset.features);
map.infoWindow.show(evt.mapPoint);

But, no matter if I pass to setFeatures a Deferred or a Feature array, that my output is the following one:

Does anyone detect the problem or the bug? I think that the problem might be related with the DOM structure of the features, because if you see the image attached, the function knows the size of the array of features, but does not display any of the related records. It is important to highlight that:

I had to manually add the geometry field to the features, maybe any other required parameter is missing and that is why the popup is showing nothing. Does it make sense?
At this moment, the info template function getTextContent() returns a string "Hello world", but it is not appearing in the popup.

Just to illustrate what I mean I have adapted ESRI's Query Related Records example to use Popup in this jsfiddle: http://jsfiddle.net/uBNAm/ I hope if you see this, you can understand fully what I mean. Just click red spots until a popup like the one above appears.

Maybe is it a bug? How should I proceed to report it?


texts: Using QGIS Field Calculator to replace backslash?

texts:
I actually use the Field Calculator "replace" formula that works very well but I have some '\' caracters in my field that I cannot replace.
ex : '\naninana' and I want to keep only 'naninana'.


texts: Loading GeoJSON in QGis results in very low resolution


texts: Reprojecting British National Grid (27700) coords to Mercator (3857) using Proj4j

texts:
On epsg.io https://epsg.io/transform#s_srs=27700&t_srs=3857&x=327420.9886680&y=690284.5471100 the BNG easting/northing coodinates 327420.988668 690284.547110 reproject correctly to -352695.04 7578309.23. If I attempt to reproject the same coordinates using proj4j (0.1.0) with the following code:

Double easting = 327420.988668;
Double northing = 690284.54711;
CoordinateReferenceSystem BNG = crsFactory.createFromParameters("EPSG:27700", "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs");
CoordinateReferenceSystem MERCATOR = crsFactory.createFromName("EPSG:3857");
CoordinateTransform trans = ctFactory.createTransform(BNG, MERCATOR);
ProjCoordinate in = new ProjCoordinate(easting, northing);
ProjCoordinate out = new ProjCoordinate();
trans.transform(in, out);
log.info(String.format("%s : %s", out.x, out.y));

I get -352695.04030562507 : 7542788.088927755.  The Y coord is around 30 miles south of the correct position.  If I use version 1.0.0 of proj4j, I get -352535.43434034986 : 7578324.217405743, which is much closer but still around 200 meters out.

Incidently if I reproject first to EPSG:4326 then to EPSG:3857, I get the correct result.


texts: Twitter REST API missing geo-tagged tweets from Europe

texts:
I used twitter's REST API to get few thousands tweets from last two days. Everything went ok, but when I put tweets on the map, there is empty "box-like" area (no tweets for almost entire Europe - look at 1st picture).

Last week I used REST API to get data from around India and everything were ok (look at 2nd picture).

I used GET search/tweets with geocode parameter:

"
Returns tweets by users located within a given radius of the given latitude/longitude. The location is preferentially taking from the Geotagging API, but will fall back to their Twitter profile. The parameter value is specified by “latitude,longitude,radius”, where radius units must be specified as either “mi” (miles) or “km” (kilometers). Note that you cannot use the near operator via the API to geocode arbitrary locations; however you can use this geocode parameter to search near geocodes directly. A maximum of 1,000 distinct “sub-regions” will be considered when using the radius modifier.

Example Values: 37.781157,-122.398720,1mi
"

More at: https://dev.twitter.com/rest/reference/get/search/tweets

Anyone seen this problem? Any clue?

In my case I used central point around like this "20.0,50.0,2500mi"


texts: Adding geodatabase connection from another PC to SQL server 2014?

texts:
I have a problem that I can not solve. I install SQl server 2014 and create Test1 database on My PC. Now I want to add Geodatabase connection in Arccatalog on Another PC. But it error below.
Firewall and Antvirus is disable on my PC. Both of PC is also the same network.
I try:
 DESKTOP-1BB1A4S\SQL
 DESKTOP-1BB1A4S\SQL, 1433
 192.168.1.2\SQL, 1433

What do I do wrong?

Note: I can add connection on my PC.


texts: gdal2tiles QGIS 3.10 not referenced properly

texts:
I processed virtual rasters with gdal2tiles. The output seems reasonable and it is displayed correctly on the generated output maps (Leaflet, Openlayers, Google). I then copied the tiles to a nginx webserver. This server I connected as XYZ in QGIS 3.10.

The tiles are not at the correct geographic location.
The order/arrangement of the displayed tiles is incorrect.
QGIS crashes.

The input virtual rasters are in EPSG3857. The following GDAL command has been used:
python3 -m gdal2tiles -p mercator -z 8 -w none -r average -s EPSG:3857 -a 0.0 C:/Users/usr/AppData/Local/Temp/processing_e4fd1fe4809945ec86e3d5caede62eaa/f7ff49e364cc4f3bb55dc2a7d5fae023/OUTPUT.tif X:\02_GIS\901_QGIS\QGISServer\tiles\smr


texts:
I'm developing glrpt software for reception and decoding satellite images. We already have code that performs fixing of tangential scan distortion (see here for algorithm description). I suppose that as a result we're getting so-called orthoimage (or orthorectified image). Example image:

My plan is to add geo overlay feature to glrpt (as WXtoIMG provides) and I want to use NaturalEarth database (which is in EPSG:4326 - WGS84 format). However because I'm new to GIS I want to play in qgis to become familiar with GIS theory. I've tried to geo-reference my raster image and overlay ocean layer from NaturalEarth. I've used recommended plugin for that and it asks me about coordinate system for raster image. I've tried to select UTM for northern hemisphere but with no luck - overlaying is wrong, even rotation is wrong. So I wonder how to deal properly with rectified images (orthoimages) from satellites? Could someone give me a hint how to properly perform conversion to EPSG:4326 - WGS84 format and overlay images?
Actually I've realized that it might be simpler to project my shapefiles from NaturalEarth on plane instead. I think after correction of tangential scan distortion I have orthoimage where 1 px corresponds roughly to 1 km on Earth (according to the Meteor-M2's MSU-MR instrument specs). But I can't find any notes about such projection...
UPDATE:
Okay, I was able to do rough georeferencing of my orthoimage. Here is the result with ocean and lakes layers from Natural Earth:

I understand that I should select more points and do more thorough georeferencing but it will be later a bit. Now I wonder if there are any ways to perform backward transformation so my NE dataset will be warped to fit orthoimage?


texts: Python Labelling in ArcGIS - Two Languages one string

texts:
I am trying to format a label in two languages in a way they appear on one line and not stacked in ArcGIS any ideas? Maplex Stacked label feature is not ticked so this does not help.
This is how they currently appear when labelled with the following python code:

  River Corrib Abhainn Na Gaillimhe

def FindLabel ([ENG_NAMED_RIVER], [GLE_NAMED_RIVER], [GAELTACHT_AREA]):
    try:
        s =[ENG_NAMED_RIVER]
        s = s.title().upper()

        if ([GAELTACHT_AREA]) == "Y":
            return "<ita>"  +  ([GLE_NAMED_RIVER]) + "</ita>"
        elif ([GAELTACHT_AREA]) == "N":
            if [GLE_NAMED_RIVER] is None and [ENG_NAMED_RIVER] is not None:
                return (s)
            else:
                return (s) + '\n' + " " + "<ita>"  +  ([GLE_NAMED_RIVER]) + "</ita>"
    except AttributeError:
        pass

But I just want the label to read like:

  River Corrib Abhainn Na Gaillimhe


texts: Elevation Map from Slope and Aspect Rasters

texts:
I am trying to create an elevation map (e.g., recreate a DEM) from the following input data:

Slope Raster
Aspect Raster
ASCII file containing XYZ data points (Easting, Northing, and Elevation for about a dozen locations)

I cannot find any information on how to go about doing so. Also worth noting that I did not create the slope and aspect rasters from an original DEM.


texts: Trying to map numerous attributes on a map in MapInfo

texts:
Any help would be much appreciated for the following problem:

Based on grouping postcode sectors together I have created 30 sales areas in the country. These sales areas have been made visible on the map using normal thematic mapping (separate colour for each area to make them easy to differentiate).
For each sales area I want to show the following attributes in the centre of that sales area:

Product Market Share - an absolute value
Sales Volume - a graphical representation (e.g. size of circle)
Target Area - Yes or No
Main Competitor - Choice of 3
Contract Renewal Date - Choice of 3 (less than 12 months, 12-24 months and more than 24 months)

Does anyone know if this is possible?

My thinking so far, although untested is:

If I can create a point in the centre of each sales area (not sure how to do this though!?), I could use dispersed groups as the font for this point, with 3 squares which are colour co-ordinated to show attributes 3, 4 and 5 above.
If I can create another point next to the first one, I could create a pie chart showing the market share, where the size of the pie chart indicates the volume of sales. This would cover off attributes 1 and 2 above.

Many thanks for any help that can be given!

All the best

Kev


texts: ArcGIS Javascript API - How to submit a defect?

texts:
I would like to know the best way to notify ESRI of a possible defect in the JSAPI and gis.stackexchange seems like the best mechanism for doing so (Derek reads it and fixes it).  That being said, what is the proper way to notify ESRI of a defect?

The defect in this case is posted on jsfiddle and can be seen by placing the mouse over the map.  Notice the onMouseMove event continuously fires.  This required a workaround on my part because I was using the onMouseMove event to re-project (esri.config.defaults.geometryService.project) coordinates and if the user left the mouse over the map it was eating up bandwidth.

Documentation states:

  Fires any time the mouse pointer moves over the map region. A common
  use for this event is to show the current x,y coordinate of the map as
  the user moves the mouse pointer.

Hence the claim that this is a defect.  This is true in 2.8 and 2.9 (beta)


texts: Failing to load OS .gz files into QGIS 3.16 using OS Translator II

texts:
I'm new to QGIS and not strong on writing scripts or code. That said I've installed QGIS 3.16, PostGIS 3.1.0,  PostgreSQL 13 and also OS Translator 2 and followed the configuration guidance at https://www.lutraconsulting.co.uk/projects/ostranslator-ii/ to add the symbol files, fonts and SVG paths which look like this ..
I've created a connection to the database ...

The OS  Translator 2, is configured as follows

When I press Ok to run the translator I get the following error message:

I suspect I'm making a / some simple mistake(s).


texts: Open Georeferencer and load raster at startup

texts:
I would like to start QGIS from the command line. At startup the Georeferencer Plugin dialog should automatically appear and a predefined raster should be loaded.

What's the best and most simple way to achieve this?

I'm aware of the QGIS Command Line Options and I guess I have to write a small Python script to do what I want at startup. Unfortunately I have no programming experience in Python.


texts: Get OpenLayers 3 to load more than one WKT feature

texts:
I have OL3 loading a wkt feature from a string here:
http://codepen.io/vbahole/pen/GqWQdJ

I'm now trying to load two WKT features at once using the format.readFeatures() method. But i can't get it to work and I don't know what format OL wants that wkt string to be in.


texts:
I'm trying to create a VB label expression on streets such that streets with an alternate name (ACS_ALIAS) will be labeled with the LABEL name and the alternate name in parentheses; streets with no alternate name will be labeled with the LABEL name only. Here is what I tried but to no avail:

Function FindLabel ( [LABEL], [ACS_ALIAS] )

if ( [ACS_ALIAS] <> <Null> ) then

FindLabel = ( [LABEL] & " (" & [ACS_ALIAS] & ")" )

elseif ( [ACS_ALIAS] = <Null> ) then

FindLabel = [LABEL]

end if

End Function

I can only think of some non-expression workarounds.


texts: Selecting features within certain buffer distance of selected feature using PyQGIS?

texts:
I have a shapefile of thousands of polylines. I have select one feature, I want to select all other features that is within say 100m of the selected feature.

How do I achieve it by pyqgis?


texts: Cannot st_linemerge a multilinestring because its not properly ordered


texts: How do I drag item/file from ArcCatalog to custom UI form created with Toolbar Add-in?

texts:
I have created a button add-in in ArcMap that pops up custom UI/Form. I want to drag and drop file from ArcCatalog into the textbox on the Form. I am able to do so with windows explorer but not from ArcCatalog.

I'm writing code using C#. When I drag the file from catalog, I am sure DataFormats type is not FileDrop. Any suggestions?

private void openShapeFileTextBox_DragEnter(object sender, DragEventArgs e)
    {
        if (e.Data.GetDataPresent(DataFormats.FileDrop))
        {
            e.Effect = DragDropEffects.Copy; // Okay
        }
        else
        {
            e.Effect = DragDropEffects.None; // Unknown data, ignore it
        }
        nameTextbox.Text = temp;
    }


texts: Setting visible scale ranges for summary widget clusters in Web AppBuilder for ArcGIS?

texts:
I am currently working with Web AppBuilder for ArcGIS Developer Edition 2.4 to create a number of web maps for my company. One in particular uses the summary widget to show clusters of features at specific locations (see image).

The clusters of course can be turned on and off however I have been presented with two specific issues.

I cannot find a way to only show the clusters at specific visibility scale ranges. I would like it so the summary clusters turned off at a specific map scale, so the user doesn't have to turn the widget off and on regularly.
I would like to have both the summary widget and bookmark widget open on launch. This currently doesn't seem to work as the summary widget overrides the bookmark widget. If you set the summary widget to off, the bookmark tab shows on launch.


texts: Export DXF from QGIS layer using PyQGIS?

texts:
I want to export a DXF file from a QGIS layer.

Sample code:

dialog = QtGui.QFileDialog()
dialog.setFileMode(QtGui.QFileDialog.Directory)
dialog.setOption(QtGui.QFileDialog.ShowDirsOnly)
DirectoryName = dialog.getExistingDirectory()
layers = self.iface.mapCanvas().layers()

for layer in layers:
     filename = DirectoryName + "/" + layer.name() + ".dxf"
     QgsVectorFileWriter.writeAsVectorFormat(layer, filename, "utf-8", layer.crs(), "DXF", 1)

Result DXF file is empty.

How can I export as DXF file using either QgsVectorFileWriter() or QgsDxfExport()?


texts:
I am trying to label a map I'm creating in QGIS v 2.8.9. I'm using data defined labeling to both manually place and rotate labels. I've created the required fields (X, Y, and Rotate) all as decimal with a width of 10. Up to today, I've had no problem editing the labels and saving these edits. However, today, upon moving some labels, and subsequently saving the edits, all the labels (edited today, not earlier edits) snapped back to their original positions. Here's an example:

As you can see the labels for the lakes all show highlighted because they are now pinned since I edited them. Now, when I save the layer edits, this happens:

The labels snap back to their pre-edited positions.

All my layers are shapefiles and have not been touched in ArcGIS at any point if that helps. Also, it seems to only be affecting labels. I can still edit and save polygon, point, and line features.


texts: Creating Indexes Within View and Speeding up Spatial Queries Over View?

texts:
I´m trying to add a view from postgis using QGIS, what´s facile. The problem is that it´s taking too long to load it and to perform any kind of operation, for example, as simple as counting rows. It´s a complex view, with 627 rows, and large geometric attribute.

Is it possible to create indexes within a view?

It must be told that geometric features repeat over the View, I mean, the same feature appears twice or even more along the View.

Is that what is limiting my performance?

The Postgres/PostGIS is actually running on a remote CentOS server which is in the same network as my desktop (no firewalls or proxy). The view query requires 68531 ms to run, but when I load it to QGIS, if I may say, it stucks.

SELECT h.gleba, sum(h.potencial) AS potencial, sum(h.parc_sem_req) AS parc_sem_req, sum(h.parc_com_req) AS parc_com_req, h.fronteira, h.regional, h.gleba_situacao, h.the_geom,
        CASE
            WHEN h.categoria = '>1mf'::text THEN sum(h.potencial)
            ELSE 0::numeric
        END AS maior_que_um,
        CASE
            WHEN h.categoria = '<1mf'::text THEN sum(h.potencial)
            ELSE 0::numeric
        END AS menor_que_um, h.assent_prev_nro, h.consulta_resultado, sum(h.total_parc) AS total_parc, h.gid_gleba
   FROM ( SELECT DISTINCT ON (t.id) t.gleba, t.total_parc, t.potencial, t.id, t.fronteira, t.regional,
                CASE
                    WHEN t.tamanho_mf >= 1.00000::double precision THEN '>1mf'::text
                    WHEN t.tamanho_mf < 1.00000::double precision THEN '<1mf'::text
                    ELSE t.tamanho_mf::text
                END AS categoria,
                CASE
                    WHEN t.situacao_processo IS NULL THEN count(1)
                    ELSE 0::bigint
                END AS parc_sem_req,
                CASE
                    WHEN t.situacao_processo IS NOT NULL THEN count(1)
                    ELSE 0::bigint
                END AS parc_com_req, t.assent_prev_nro, t.consulta_resultado, t.gleba_situacao, t.the_geom, t.gid_gleba
           FROM ( SELECT DISTINCT ON (p.id) count(1) AS total_parc, p.id, p.gleba, round(p.area_ha_utm / d.mod_fisc::numeric, 30)::double precision AS tamanho_mf, p.fronteira, p.regional, p.gleba_situacao, g.the_geom, g.gid AS gid_gleba,
                        CASE
                            WHEN (p.situacao_processo = ANY (ARRAY['Requerimento Realizado'::text, 'Processo em Análise'::text])) OR p.situacao_processo IS NULL THEN count(1)
                            ELSE 0::bigint
                        END AS potencial, p.situacao_processo, g.assent_prev_nro, g.consulta_resultado
                   FROM work_rafael.vw_parcelas p
              LEFT JOIN work_rafael.dv8 d ON p.municipio_id::numeric = d.cod_mun::numeric
         LEFT JOIN fundiario.vw_glebas g ON g.gid = p.gid
        WHERE p.natureza = 'Particular'::text
        GROUP BY p.gleba, p.area_ha_utm / d.mod_fisc::numeric, p.situacao_processo, g.assent_prev_nro, g.consulta_resultado, p.id, p.fronteira, p.regional, p.gleba_situacao, g.the_geom, g.gid) t
          GROUP BY t.gleba, t.tamanho_mf, t.potencial, t.situacao_processo, t.assent_prev_nro, t.consulta_resultado, t.fronteira, t.total_parc, t.id, t.regional, t.gleba_situacao, t.the_geom, t.gid_gleba) h
  GROUP BY h.gleba, h.assent_prev_nro, h.fronteira, h.categoria, h.consulta_resultado, h.potencial, h.regional, h.gleba_situacao, h.the_geom, h.gid_gleba

I don´t know if I would have put it integrally, sorry if I wouldn´t. Essencially, the query joins one table and one view to provide all the infomation I want. The the_geom field came from "fundiario.vw_glebas" ("...LEFT JOIN fundiario.vw_glebas g ON ...". In FROM, we call another view, 'work_rafael.vw_parcelas', which derived from another and the another from other and so on.

I guess this is what is limiting my performance, isn´t it?


texts:
We have basemap with shapefile, now we have purchased ArcGIS 10.2 with server and ArcSDE and Oracle. We want to establish Enterprise level so that multiple users can edit without overwrite the source file.

I want to know how start and how to execute?


texts: How to combine a road network to multiple shapefiles with no shared attributes

texts:
I am trying to create an agent-based model and I need a .CSV file that contains the attributes of a routable road network and a number of other shapefiles I have.

I have the following:

Ordnance Survey Integrated Transport Network shapefile
Office for National Statistics 2011 LSOA Boundaries shapefile
Office for National Statistics 2011 LSOA population-weighted Centroids shapefile
a self-made shapefile that contains half a dozen points that represent hospitals

How, in QGIS, can I combine the attributes of all the above shapefiles?

In my model, I need to be able to load the road network, then use a .CSV file to assign my agents certain 'home' locations (using info in the LSOA shapefile above), then have my agents use the road network to navigate to other certain points (LSOA Centroids or Hospitals).

The shapefiles do NOT have any shared attributes.


texts:
As far as I can see there is nothing in the GeoJSON standard to store styling information, i.e. line colours, thicknesses etc.

Am I missing something or is this just something that GeoJSON doesn't deal with?


texts: Get the tiles? (GeoWebCache, GeoServer, PostGIS, REST)

texts:
I've got a PostgreSQL (9.2.9) database, PostGIS (2.1.3) enabled - and it works fine with GeoServer (2.5.2).

So by now I'm trying to make tiles of the map with the integrated GeoWebCache - but I don't get it going, because I don't know where to find the specific information for the REST service. I've read the following resources:

http://sourceforge.net/projects/geowebcache/?source=typ_redirect

http://suite.opengeo.org/4.1/geowebcache/services/tms.html

http://docs.geoserver.org/2.5.x/en/user/geowebcache/using.html

http://docs.geoserver.org/2.5.x/en/user/services/virtual-services.html#virtual-services

But I don't see what input (URL? parameters? lat/lon bounding box? zoomfactor? scale?) is required and what I can expect to get as output (the tiles, of course, maybe some additional information).

Is there any straight example I can rely on to get a first and simple start?


texts: Seeking binary thresholding tool in ArcGIS Desktop

texts:
I am using ArcGIS Desktop 10.6.

I want to perform OTSU thresholding.

Where is the binary thresholding tool in ArcGIS Desktop 10.6?


texts: Calculating parameters for SQLServer raster to Esri grid script?

texts:
My question is related to Converting SQL Server Rasters to ASCII Grid?

I would like to transform the data in the database into Esri grid format.

I would like to write the program/script myself and wonder how these values are computed:

xllcorner, yllcorner, cellsize

I know that my squares are 25km^2. The wiki site mentions easting and northings. Should I just transform the lower left latitude/longitude values into easting and northings and use 25 for cellsize?


texts:
In this case I'm working with county lines from TIGER, but in general, I'm trying to sort out how to know what CRS my data is in.

I thought this would be in the shapefile's .prj but all I see there is:

EOGCS["GCS_North_American_1983",
DATUM["D_North_American_1983",
SPHEROID["GRS_1980",6378137,298.257222101]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]]

Is there a reliable way to discern the CRS of any one shapefile?


texts: QGIS v3.10.6 and MacOS 11 (Big Sur): Compatible or not?

texts:
I have not found any conclusive answer from Web searches, including QGIS Web site, whether QGIS v3.10.6 is compatible with the current MacOS 11 (Big Sur) on an Intel-based Macbook Pro (2019).
Any help from readers here?


texts: Help choosing most suitable bivariate choropleth mapping coloring scheme

texts:
I am trying to overlay a nominal variable (2 categories - rainfed vs irrigated) in a choropleth map over a numeric variable.

In order to highlight the difference in pattern among the two categories, I have outlined one category with a different color (irrigated areas in "red"), while the uncoloured ones are rainfed areas.

However, the map feels cluttered and the outline mixes with darker shades of the numeric variable.

I am trying to avoid using two different color shading schemes to represent the two categories as I feel that would hide the overall distribution of the underlying variable.

Is there a better way to represent this bivariate classification using the ggplots2 package in R (which I am currently using it for making the attached map)?

These maps are eventually going to be printed on paper.


texts: Attributing polygons based on line attributes

texts:
I'm using QGIS 2.18.
I have a grid that I need to calculate Azimuth and length for each side.  Most have 4 sides but some ( see Gird C below) many more , up to 12.

My process now convert Polygon to lines, then clean the lines to break at the intersections, then calculate the azimuth with the following degrees(azimuth(start_point($geometry), end_point($geometry))) then calculate the length of each line using $length with the field calculator then make a duplicate of the layer , label azimuth on the bottom of the line in red (see below) and then in the second layer label the distance in blue on top of the line (see below) then by hand transfer the data to a spreadsheet,  I start in the NW corner and then move clockwise.

Any help on how to automate this would be great as I am trying to get into scripting in Q.


texts: Band calculation error with rasterio in Python

texts:
I am new to GIS in Python and want to perform a simple band calculation from Sentinel-2 imagery using rasterio and numpy – specifically, I want to divide Sentinel Band 11 (SWIR) by Band 8 (NIR) to map snow/ice.
I have written the following code:
    import numpy as np
    import rasterio as rio

    band11 = rio.open('filename_b11.jp2', driver = 'JP2OpenJPEG') #swir
    band8 = rio.open('filename_b8.jp2', driver = 'JP2OpenJPEG') #nir

    # convert to float
    swir = band11.read(1).astype('float64')
    nir = band8.read(1).astype('float64')

    # divide swir by nir
    band_calc = (swir / nir)

This produces the following error:
    ValueError: operands could not be broadcast together with shapes (5490,5490) (10980,10980)

How do I handle this error (i.e. where the shapes of the two bands are not matching) to perform the band calculation, and similar calculations such as the NDSI?


texts: Creating lines along calibrated polyline from M values in ArcMap

texts:
I have an M-value enabled polyline feature class and from-to M-values of lines.
The polyline is already calibrated.
Is there any way to create line along the calibrated polylines or get that segment of line using (from-to) M-values in ArcMap?


texts:
I am geodesy student from Slovenia. For my report I chose working with QGIS and I am having problems with SCP-classification.

So, I am working with Landsat 4-5 TM year 2006 and I would like to classify in 4 groups. I have done the cropping and preprocessing correcturres and have created raster od band set (stack bands) from bands 1,2,3,4,5 and 7.
When I start with SCP Dock and clicing ROI signature QGIS says:

  Warning [12] : The following signature will be excluded if using
  Maximum Likelihood (singular covariance matrix). Macro: 1 ID: 8

I don't know how to fix the problem.


texts:
I am trying to convert vector shapefiles into Google Maps Datum using QGIS.

Do you know which one is the datum?

When I tried to convert them into WGS84 EPSG 3857, I could see that the shapes of the buildings didn't fit very well with those which are in Maps.

I've already tried using both EPSG:3857 and EPSG:4326. I don't have any good results.


texts: Joining multiple tables with the same columns

texts:
I have one main shapefile with many various attributes. It does include an ObjectID to act as the basis for a join/merge. This shapefile was distributed out to multiple people, who each worked on specific attributes within that file. The attributes all started out with a value of NULL before being distributed.

I am now working on creating a Modelbuilder tool using an iterator to go through these tables and add the new data from each person back into the original shapefile.

I need the new data to overwrite the NULL values for each attribute. I don't have experience with Python and I am fairly new to Modelbuilder as well.

I am currently using 'Iterate Feature Classes' in combination with 'Join Fields', but so far it's not working out. Here's what I have right now:

I have that nested in another model that calculates fields, but my problem lies here and I don't think it will be necessary to nest anyways.

What is the best way to go about this?


texts: DEM, points values and elevation to create a map of temeperature

texts:
I am using SAGA - Universal Kriging (Global) for this, but I am stucked. I have grid (.tif) for Serbia with elevation values, and .shp file with points that have mean yearly temperature. I want to create a map using these two files and to take in to the account that Temperature gradient in Serbia is 0.6°C. Temperature gradient means that for every 100m temperature is changed for 0.6°C Also i have the elevation for the .shp file with points, but i don't know how to combine all this.
So I want to display a map of the temperature, extrapolated around the known points according to the DEM.
Is that possible?


texts: SLD style definition from GeoServer to Drupal

texts:
I've been experimenting with the SLD style definitions in both GeoServer and Drupal. What I want to achieve is to create a new style in GeoServer (by a curl operation, but I know how that works) and sync that style to Drupal's GeoServer Structure.

In the GeoServer itself, the styling applies perfectly when going to the Layer Preview. Also adding a new style in Drupal will sync itself to the GeoServer, BUT not the other way around...

So basically my question: Is it possible to sync a GeoServer style to Drupal?

Thanks in advance.


texts: Show Duplicate GPS point from CSV file in QGIS

texts:
I want to load a *.csv file containing GPS data into QGIS. In my file, there are some duplicate coordinates (two different people living in same household). And I want them to show as two points because they represent two different people. But QGIS only shows one point and ignores the other one.

Do you have any solution for this issue?

I think maybe creating different .csv file (to separate duplicate data) might solve this issue but I haven't tried it yet and it's not good solution because I have a lot of GPS data.


texts: django floppy forms geospatial widgets error

texts:
I'm trying to define a view that lets the user edit the data in the database, I'm using floppyforms, because of its geodjango widgets which is part of the form that i would want the user to use for adding and editing/updating their data so this here's the code:

def editPath(request, path_id, template_name="routes/path_form.html"):
    if not request.user.is_authenticated():
        return redirect('/login')
else:
    try:
        path = Path.objects.get(pk=path_id)
    except Path.DoesNotExist:
        raise Http404
    if path_id is not None:
        if request.method == "POST":
            form = PathForm(request.POST, instance=path)
            if form.is_valid():
                s = form.save()

                return redirect("/route#paths")
        else:
            form = PathForm(instance=path)
    else:
        form = PathForm()

    return render_to_response(template_name, locals(), context_instance=RequestContext(request))

but when i save it, i get this type error that says:

  strftime() argument 1 must be string or read-only buffer, not tuple

I think the error is with the floppyforms geodjango widget for the path field, am i missing something?  or did i get my view wrong? thanks in advance.

I'm using the widgets for linestrings from floppyforms


texts: For a very basic situation where you have a Boolean parameter in a model and you want to specify if value="Yes" go-to algorithm A in the model if value="No" go-to to algorithm B, for example, how can I easily do this?


texts:
Starting off I've set up Apache Tomcat as my server , and used GeoServer for my data.
Now I want to get my data from localhost:8080 to my domain. Does anyone know how to do that. Any ideas or any references to documentation ?


texts: Issues to be aware of running ArcGIS Desktop on Mac?

texts:
I'm considering upgrading the PC to a MacBook Pro and installing Parallels, and would like advice from other ArcGIS Desktop users who have done this.

The performance aspects of VM-ware are considered in this thread, but are there any other issues to be aware of?

How is the file system handled when defining layers in ArcMap, when on a Mac?  eg, is there a concept of the C: drive? Is the Windows file system handled by Parallels (with Windows 7 installed)?

I only need occasional access to ArcGIS Desktop, so performance isn't a huge concern. I'd like to hear of any other problems that I should consider before committing.


texts:
In QGIS there are 2 options to style labels.

Using the style properties.
Using the label in the toolbox

When I dbl click layer -> styles -> save as SLD , the style of the label isn't saved in case I use the 2nd option.

Is there an option to save it so I can import it to GeoServer ?


texts: Changing Dataframe Projection of .MXD to UTM Zone matching each polygon in ArcPy cursor?

texts:
I have a polygon shapefile.

I used ArcPy scripts to:

add a new field to the shapefile
use Calculate UTM Zones on each polygon.

It spits out UTM projection information into the field I've added.

I would like to use a cursor to go through each row of the polygon shapefile's attribute table, using this added field.

For each row in the field, the cursor would:

Change the projection of the entire data frame in the .MXD to the UTM projection in the calculated UTM field for that polygon <-- The part I need help with.
Zoom to the polygon (with a 1400% margin)
Export a PDF
(continue)
(at the end) - Combine all PDFs into one book, and delete the extras.

All I've been able to find so far are scripts that change to things in projection files, or to one given projection. Are the UTM zone calculations from this command usable in this way, to alter the projection? I'm not sure how to do it if so.

-

I tried doing something similar with data driven pages, using the calculated UTM zone as the spatial reference in the data driven page setting, but it is not changing the projection for some reason - which is the entire point of this code - so this is the alternative that I've come up with.

=================

OP here again.

I should probably point out that I'm a serious novice in Python.

I have looked at the .PRJ file example but honestly don't understand it.

I tried using WKID's but they didn't do what I wanted, either - I just want to use the information I already have if I can, of the calculated UTM's. Their data looks like this for every row of the table:

PROJCS["GCS WGS 1984 UTM Zone 57H (Calculated)",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",

I have this code that I'm trying to modify to do what I want and it's just not working.

(unique_name is defined as the UTM shapefile elsewhere in the code)

fc = unique_name
cursor = arcpy.da.UpdateCursor(fc, ["UTM_Zone"])

with arcpy.da.UpdateCursor(fc, ["UTM_Zone"]) as cursor:
    for row in cursor:
        inData = fc
        coordinateSystem = row[0]
        arcpy.DefineProjection_management(inData, coordinateSystem)

My thinking was, if inData is the shapefile, UTM_Zone is the field I want to use, and the projections are in each row of the UTM_Zone field, this would work.

I searched elsewhere for how to clear the projection so that I can define it with this code, and got this, which isn't failing, but I don't know if it's the proper code to do this either.

try:
    newSpatialReference = arcpy.SpatialReference()
    newSpatialReference.loadFromString('{B286C06B-0879-11D2-AACA-00C04FA33C20}')
    print ""
    print "* SUCCESS: Map's Spatial Reference cleared."

except Exception as ex:
    print ex.args[0]

Help?


texts:
I’m using QGIS 3.10, PostgreSQL 10 and PostGIS 2.5. I want to dissolve within a Python script a shapefile so that the result is dissolved by one field and the number of different values of another field are counted.
I tried different ways:
I used ‘postgisgeoprocessing:dissolvepolygons’:
inputfile = "C:/QGIS/Vers1/Results/superClean.shp"
dissfield = "NUMMER"
statatt= "EINZELFNR"

processing.run("postgisgeoprocessing:dissolvepolygons", {'INPUT_LAYER': inputfile,'DISSOLVEALL':False, 'FIELD':dissfield,'SINGLE':False,'COUNT':True,'AREA':False,'STATS':True,'STATSATT':statatt,'SCHEMA':'public','TABLE':'dissolved4','OPTIONS':''})

That runs without error, but I don’t know where I would find the result.
I also tried qgis:dissolve
inputfile = "C:/QGIS/Vers1/Results/superClean.shp"
outputfile = "C:/QGIS/Vers1/Results/supercleandiss14.shp"
dissfield = "NUMMER"
geometryfield = "geom"

processing.run("qgis:dissolve", {'INPUT':inputfile, 'FIELD': dissfield, 'GEOMETRY': geometryfield, 'KEEP_ATTRIBUTES': False, 'COUNT_FEATURES': True, 'OUTPUT':outputfile})

That runs without error and produces a dissolved shapefile. But the attribute table has all fields from the original layer and there is no field which counts the features.
Similar:
inputfile = "C:/QGIS/Vers1/Results/superClean.shp"
outputfile = "C:/QGIS/Vers1/Results/supercleandiss15.shp"
dissfield = "NUMMER"
geometryfield = "geom"
statatt= "EINZELFNR"

processing.run("qgis:dissolve", {'INPUT':inputfile, 'FIELD': dissfield, 'GEOMETRY': geometryfield, 'KEEP_ATTRIBUTES': False, 'COUNT_FEATURES': True, 'COMPUTE_STATISTICS': True, 'STATISTICS_ATTRIBUTE': statatt, 'OUTPUT':outputfile})

That runs without error and produces a dissolved shapefile. But the attribute table has all fields from the original layer and there is no field which counts the features.
Or with gdal:dissolve:
inputfile = "C:/QGIS/Vers1/Results/superClean.shp"
outputfile = "C:/QGIS/Vers1/Results/supercleandiss15.shp"
dissfield = "NUMMER"
geometryfield = "geom"
statatt= "EINZELFNR"

processing.run("gdal:dissolve", {'INPUT':inputfile, 'FIELD': dissfield, 'GEOMETRY': geometryfield, 'KEEP_ATTRIBUTES': False, 'COUNT_FEATURES': True, 'COMPUTE_STATISTICS': True, 'STATISTICS_ATTRIBUTE': statatt, 'OUTPUT':outputfile})

That doesn’t produce anything.
So what can I do? I originally tried to do that in PostGIS. So exported the shapefile into PostGIS and then wanted to send an SQL string to PostGIS, get back the result as table and join it to a shapefile. But I failed to send an SQL string to PostGIS and get a table back (See Join the result of an SQL query from PostgreSQL to QGIS). I’m open for other ways to achieve in Python for QGIS the following: Union two layers and then apply a group-by query to the union layer. The result should be a table which I then can join to one of the original layers. Shouldn’t actually be that difficult I would have thought.


texts: Apply QGIS Style to osm-File like in Open Cycle Map, Landscape Base-Layer

texts:
I try to mimick a rendering style like in Open Cycle Map (landscape base layer) in QGIS. However, I'm not able to find certain elements (i.e., wood and rivers) that are used in Open Cycle Map but seem to be missing in the extract. Does someone know why this is and how I could procede?
Edit:
For specification of the issue: I have an extract taken directly from OpenStreetMap (see here) (saved to my dropbox here). And another extract from an API call (http://open.mapquestapi.com/xapi/api/0.6/*[bbox=10.7,47.200,10.875,47.350]), covering about the same area (in fact the one from the API is a bit larger). The extract from OpenStreetMap shows, i.e. feature 199333058 (a large forested area), which I can't find in the extract that comes from the API (I opened the files in Notepad and searched for the ID in both osm-files). Also searching for the feature after opening the API-extract in QGIS was to no evail..


texts: How to get long tap, right click or such events on OpenLayers5?

texts:
I want to get some pointer events like

long tap
right click

Are there any examples or documentations for archive them?


texts: Score neighborhood based on itself and its neighbors for all features in a data set

texts:
The problem:

I have a dataset of polygons representing neighborhoods with FSI (Floor-Space Index) values (among others). I want to consider for each neighborhood (target) the surrounding neighborhoods (features), in this case, based on a 450m radius from my feature. I want to score a neighborhood based on it's FSI and based on the score of the surrounding FSI's to in the end say something about an access level to facilities. Score of target would be something like

FSI target + 0.35 * FSI neighbors

However, this seems like quite a simple process to do for 1 feature, but I want to apply it to all my features.

Done so far

I have calculated already the significant features using ArcGIS Pro's Hot Spot Analysis (Getis-Ord Gi)* with a fixed radius.

Possible Software
QGIS with GRASS, ArcGIS Pro basic license

Possible extensions

In the future I would like to vary the chosen conceptualization of Spatial Relationship (= what does it mean to be a neighbor?) as I will use this approach also on other variables that have different underlaying mechanics e.g. a road network.

Possible solution

Build a function that takes 1 feature, use summary statistics / select by location and loop this process for each feature in my dataset.

Main question

Is there already some algorithm in QGIS / ArcGIS or a plug-in that does such a job?
Or can you recommend another approach?


texts: How to calculate a service area of a facility, while using multiple co-variables?

texts:
Problem we would like to solve is finding out what methods are to calculate the most efficient routes in a map with distance/travel time, pop density and facility capacity as co-variables! Perhaps somebody with more experience knows where to find a useful tutorial?

Currently, I have been able to create a map (see image above) using:

Eurostat data
Input from a csv with consumption rates per country

As a result, consumption per capita has been mapped on NUTS2 level in the EU.
The next thing I have done was adding the different types of facilities to the maps, based on postal codes which then have been transferred by a script to the location on the maps with the projection of CRS EPSG:3035 - ETRS89 / LAEA Europe - Projected. Sidequest: I am also wondering how to add more data to these facility points.
All of this is saved as geojson, but I suspect it would be better to use rasters instead to overcome the issue. I am new to QGIS and think the network analysis tool or an approach with Python combined with the creation of some own formulas would be a way to solve it.
What I have tried before are checking out some tutorials on YouTube, however these handle very simple queries rather than the more complex one from this issue.
Also esri's documentation on proximity analysis or finding a service area seems to answer the question partly, however it requires integration / synthesis which currently lies outside my level experience.


texts: Where does Geoserver get the Lat/Lon Bounding Box Values from?

texts:
I have an image mosaic layer using a postgis database to index the granules.

In the following screenshot where does geoserver get the values for the Lat/Lon Bounding Box from?:

If I run the following query on the coorisponding postgis table

SELECT ST_Extent(the_geom) FROM agdd_anomaly_50f;

I get the result:

BOX(-125.020833333333 24.0625,-66.479166666662 49.937500000002)

Which is consistent with the native bounding box, but not the Lat/Long Bounding box. I add new rows to the table agdd_anomaly_50f nightly, but I always set "the_geom" to be identical to all the previously added rows.

I realize if I hit "Compute from Native Bounds" that the bbox will be corrected, but somehow every so often the values change back to what's shown in the screen shot and I don't know where they are coming from. I've grepped for those numbers in all the config files I know of for the layer but nothing comes up.


texts: pushMessage (interact with widgets) from QgsTask

texts:
From my own experience and questions and answers here about QgsTask I understand I simply can't interact with GUI (widgets) from QgsTask in any way (logMessage seems to be an exception) as it freezes QGIS. In particular I would like to use pushMessage, in general turn on/off buttons etc. depending on how is subtask progressing.
Is there a way to push message from subtask? I would expect somehow flag to main process to push message from there? Just can't find any good example of this.


texts: how to skip creating an empty feature class using featureclass to featureclass in arcpy

texts:
I have a script that finds points outside of selected areas and creates a feature class in a file geodatabase. However, sometimes there are no points outside of the selected area. Currently, the script will create an empty feature class. I would like the script not to create the feature class if there are no points and then continue back to the top of the loop.
Below is the last part of the script.

I'm using ArcGIS 10.2 Desktop.

                #Below is the process to select from previous service area and civic address selections to find Outliers

                # Process: Select Layer By Location
            SubCivic_SubPD = arcpy.SelectLayerByLocation_management(CivicPoint_lay, "INTERSECT", SAoutputPolygons, "", "NEW_SELECTION")
            print "loc 1 success"
                # Process: Select Layer by Attribute
            Switch_SCivicPD = arcpy.SelectLayerByAttribute_management(SubCivic_SubPD,"SWITCH_SELECTION")
            print "Switch success"
            SwitchCivicPD_fld = ['OBJECTID']
            Outlier_test = "\outlier"+PD_NOrow+"_"+PDPNTIDrow
            whereNotEmpty = "OBJECTID"' > ' '0'
            print "SC success"
            # Process: Make Feature Layer
            OutlierMakLay = arcpy.MakeFeatureLayer_management(Switch_SCivicPD, Switch_SCivicPD_lay)
            print "Outlier Make layer success"
            arcpy.FeatureClassToFeatureClass_conversion(OutlierMakLay, SA, Outlier_test, whereNotEmpty)
            print("Outlier Script completed successfully")


texts: Why does "takes no arguments" error propagate from Arcpy example?

texts:
I was attempting to run Setup_Customers_Using_Tabular_Data , I modified the paths to fit my environment but when I run the program I receive

SetupCustomersByTable() takes no arguments (6 given)

note: I had to modify the exception clause to output this

A little investigation in IDLE showed this:

IDLE 2.6.5
>>> import arcview
>>> import arcpy
>>> print hasattr(arcpy.ba, 'SetupCustomersByTable')

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    print hasattr(arcpy.ba, 'SetupCustomersByTable')
AttributeError: 'module' object has no attribute 'ba'
>>> print hasattr(arcpy, 'ba')
False
>>> arcpy.ImportToolbox("C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Business Analyst Tools.tbx")

<module 'ba' (built-in)>
>>> print hasattr(arcpy, 'ba')
True
>>> print hasattr(arcpy.ba, 'SetupCustomersByTable')
True
>>> import inspect
>>> print(inspect.getargspec(arcpy.ba.SetupCustomersByTable))
ArgSpec(args=[], varargs=None, keywords=None, defaults=None)

This is not the only function this happens with, but all of them in the BA package.

I've never gotten any full arcpy tutorial to work from the website, am I missing something obvious setup wise?


texts:
I downloaded a Sentinel-2 product and opened with rasterio.open() all the bands I want to use.
This returns matrixes with size 10980 X 10980
I need to parse through the image using blocks of 120 X 120 (I am trying to apply a TensorFlow model to the entire tile).
def read_bands(tile):
    imgpath=path+"\\"+tile+"\\"
    bands=rasterio.open(imgpath+"allbands.tiff")
    bands=bands.read().transpose((1,2,0))
    return bands # returns a matrix (10980, 10980, 10)

# parses trough bands with blocks of 120 X 120 predicts and forms the tile output
def predict_tile(bands):
    niterations=int(bands.shape[0]/120)
    tile=np.zeros(shape=(niterations*120,niterations*120))

    for i in range(niterations):
        for j in range(niterations):
            patch=bands[(i*120):((i*120)+120), (j*120):(j*120)+120, :]
            y=model.predict(tf.expand_dims(patch,axis=0))
            y=tf.squeeze(y)
            y=tf.argmax(y,axis=2)
            y=y.numpy()
            for x in range(120):
                for w in range(120):
                    tile[(i*120+x)][(j*120+w)]=y[x][w]
    return tile

Image.MAX_IMAGE_PIXELS = None
for x in os.listdir(path):
    bandas=read_bandas(x)
    tile=predict_tile(bandas)
    im = Image.fromarray(tile)
    im.save(path+"/"+x+"/"+"clc.tif")

This code runs but when I analyse it within QGIS the results are weird. Which leaves me to suspect that variable bands isn't the real image. If I am correct how do I obtain the real image?


texts: Filter same Value Map to show specific values in different columns in QGIS

texts:
I am using QGIS 3.12.2 on Windows 10. I have created one large table layer to use as a ValueMap for multiple columns in a project. I need each column to show only the relevant values.
I have tried to add constraints but it only applies as validation on the selected values while each column still shows the full list.
Is there a way to limit the ValueMap list view to only a portion of the available values?


texts:
Is there a setting in Geocortex so that you can zoom to query results by clicking on them?

I must be missing something.  The results look good but I see no way to click and get to the visible shapefile results.


texts: QGIS Server WMS does not work in ArcGIS Desktop / ArcGIS Online

texts:
After some issues with my apache configuration (cp. QGIS-Server - 500 internal server error) and some playing around with setting up things correctly like projections, service versions,... I succeeded in setting up a QGIS Server WMS wich works great (transparency, querying, ...) ...in QGIS, as can been seen in screeshot below (the yellow parts):

Unfortunately, in my organisation some people are using gisses different from QGIS. Problem arises e.g., when trying to display the same service in ArcGIS 10.4 (via ArcCatalog, Add WMS Server), set up like this:

My ArcGIS Project is set up the same as my qgis project (crs=EPS:31468), the service seems to be drawn (note the status line: 'Drawing...') but nothing is shown at all, except the basemap:

Furthermore I tried to add the WMS to an ArcGIS Online map, with no success at all...

...and the following error:

Since I use an internal URL, Firefox is configured to connect to the internet without a proxy. Directly typed into the browser, the GetCapabilities request works:


texts: Performance of arcpy.Exists() in SQL Server enterprise gdb environment

texts:
While iterating on a list containing table names,
I used arcpy.Exists() to check if a table/featureclass exists.
This action is very time consuming.
I've ended up using a database approach select count(*) from 'tablename'
and checked the query result to check if a table exists, which works very fast.
I even tried using a readonly user/administrative user for arcpy.Exists(), still received the same performance problem.
My questions:
1. Does anyone knows why arcpy.Exists() is so slow vs SQL server (it is much faster in SDE)?
2. Any other ideas for workarounds? my list contains 400  names, I'd rather use arcpy on creating multiple db queries.


texts:
I am working on a project on QGIS. I have 50 geographical points. I would like to put on the map.

The reference system is the UTM Zone 36S. I have successfully imported the coordinates but after I attempt to add a map layer I get this notification:

Traceback (most recent call last):
  File "C:/Users/Athinodoros/.qgis2/python/plugins\openlayers_plugin\weblayers\weblayer.py", line 97, in addLayer
    self._addLayerCallback(self)
  File "C:/Users/Athinodoros/.qgis2/python/plugins\openlayers_plugin\openlayers_plugin.py", line 135, in addLayer
    self.setMapCrs(coordRefSys)
  File "C:/Users/Athinodoros/.qgis2/python/plugins\openlayers_plugin\openlayers_plugin.py", line 176, in setMapCrs
    extMap = coordTrans.transform(extMap, QgsCoordinateTransform.ForwardTransform)
QgsCsException: μετατροπή ορθής κατεύθυνσης of
(-0.285536, -21511.495948)
PROJ.4: +proj=utm +zone=36 +south +datum=WGS84 +units=m +no_defs +to +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs
**Error: latitude or longitude exceeded limits**

Python Έκδοση:
2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]

Έκδοση Qgis:
2.4.0-Chugiak Chugiak, 8fdd08a

Python διαδρομή:

['C:/PROGRA~2/QGISCH~1/apps/qgis/./python/plugins\\processing',
 'C:/PROGRA~2/QGISCH~1/apps/qgis/./python',
 u'C:/Users/Athinodoros/.qgis2/python',
 u'C:/Users/Athinodoros/.qgis2/python/plugins',
 'C:/PROGRA~2/QGISCH~1/apps/qgis/./python/plugins',
 'C:\\PROGRA~2\\QGISCH~1\\bin\\python27.zip',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\DLLs',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\plat-win',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\lib-tk',
 'C:\\PROGRA~2\\QGISCH~1\\bin', 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\site-packages',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\site-packages\\GDAL-1.11.0-py2.7-win32.egg',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\site-packages\\PIL',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\site-packages\\jinja2-2.7.2-py2.7.egg',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\site-packages\\markupsafe-0.23-py2.7-win32.egg',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\site-packages\\python_dateutil-2.2-py2.7.egg',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\site-packages\\pytz-2014.2-py2.7.egg',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\site-packages\\win32',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\site-packages\\win32\\lib',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\site-packages\\Pythonwin',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\site-packages\\Shapely-1.2.18-py2.7-win32.egg',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\site-packages\\six-1.6.1-py2.7.egg',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode',
 'C:\\PROGRA~2\\QGISCH~1\\apps\\qgis\\python\\plugins\\fTools\\tools']

I am not too familiar with the program but can anyone advise on what might the problem be?


texts: Unable to read different kind of shapefiles

texts:
I have written the Java code to read the shapefile and insert it into the table. But the way I have written code it will accept only a multistring .shp file. It fails for other shapefile geometry types, e.g. polygon.

@RequestMapping(value = "/file.htm", method = RequestMethod.POST)
    public String fileUploaded(Model model, @Validated File file,
            BindingResult result) throws IOException, SchemaException {
        System.out.println("File Name is given below");
        System.out.println("File Name is " +file.getFile().getOriginalFilename());
        String returnVal = "successFile";
        String fileLoc="D:\\SpringMVCFileUpload\\springexample\\src\\upload\\"+file.getFile().getOriginalFilename();
        java.io.File newFile = new java.io.File(fileLoc);

        // if the directory does not exist, create it
        if (!newFile.getParentFile().exists()) {
          newFile.getParentFile().mkdirs();
        }
        FileCopyUtils.copy(file.getFile().getBytes(), newFile);

        DataStore fileDataStore=FileDataStoreFinder.getDataStore(newFile);
        String typeName=fileDataStore.getTypeNames()[0];

        SimpleFeatureCollection collection = fileDataStore.getFeatureSource(typeName).getFeatures();

        SimpleFeatureIterator iterator=collection.features();

        java.util.Map params = new java.util.HashMap();
        params.put( "dbtype", "Oracle");
        params.put( "host", "localhost");
        params.put( "port", 1521);
       // params.put( "schema", "PUBLIC");
        params.put( "database", "orcl");
        params.put( "user", "mdsys");
        params.put( "passwd", "mdsys");
        DataStore dataStore=DataStoreFinder.getDataStore(params);

        SimpleFeatureSource featureSource= dataStore.getFeatureSource("COAST_TEST");

        final SimpleFeatureType TYPE = DataUtilities.createType("COAST_TEST",
                "feature_id:Integer,GEOMETRY:MultiLineString,SCALERANK:Integer"
        );
        SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(TYPE);
        int i=0;
        ListFeatureCollection dbCollection=new ListFeatureCollection(TYPE);
        while(iterator.hasNext()){
            SimpleFeature feature=iterator.next();
            featureBuilder.add(i++);
            featureBuilder.add(feature.getAttribute("the_geom"));
            featureBuilder.add(feature.getAttribute("scalerank"));
            SimpleFeature dbFeature = featureBuilder.buildFeature(null);
            dbCollection.add(dbFeature);

        }

    Transaction transaction = new DefaultTransaction("create");
        if (featureSource instanceof SimpleFeatureStore) {
            SimpleFeatureStore featureStore = (SimpleFeatureStore) featureSource;
            featureStore.setTransaction(transaction);
            try {
                featureStore.addFeatures(dbCollection);
                transaction.commit();

            } catch (Exception problem) {
                problem.printStackTrace();
                transaction.rollback();

            } finally {
                transaction.close();
            }
        } else {
            System.out.println(typeName + " des not support read/write access");
            System.exit(1);
        }

        if (result.hasErrors()) {
        //  System.out.println("File Name is given below");
            returnVal = "file";
        } else {
            MultipartFile multipartFile = file.getFile();
        //  System.out.println("File Name is given below");
            returnVal = "successFile";
            }
        return returnVal;
    }

In the above code you will see that Simplefeaturetype object TYPE for table "COAST_TEST" geometry field accepts only multistring. How do I let that object have different type for geometry field based on the kind of shapefile I am uploading?


texts:
I have a database that I viewed in QGIS using PostGIS.

I managed to link them up using the correst host, database combination last year. I am now revisiting the work and am unable to link them again. The appropriate extentions are installed in Postgres (i use pgadmin), namely postgis and postgis_topology. However when connecting through QGIS it says I cannot connect.

Having had an explore in my postgres database in pgadmin I am recieving the following error when I click on spatial tables:

could not load library "/usr/pgsql-9.2/lib/postgis-2.0.so": /usr/pgsql-    9.2/lib/postgis-2.0.so: undefined symbol: pj_get_spheroid_defn

The version of postgres is: 9.2.10

When I request the version of postgis the same error message occurs.


texts:
i'm having problem with geometry column, for some rows i have geometry with blank text, this query will describe more the problem :

select geom, ST_AsGeoJSON(geom), ST_Isvalid(geom), ST_IsEmpty(geom) from polygons

so the rows do not have empty geom but i can see their geometries using qgis.

any help to solve this problem


texts: make permanent point profile or distinguish between multiple levels in one profile

texts:
I have been struggling with a problem in ArcGIS for some time now and wanted to check if someone else have come across a similar issue. I have read posts that come close to what I want, but not exactly. I'll try to explain:

I have extracted XYZ point-data for multiple, superimposed layers in the subsurface along a 2D profile. I wanted to use Arc in order to create graphs/profiles where x-values (length between points) are common for all my layers, while keeping y-values variable for depth. Essentially converting UTM xy to M values and thereby giving my layers a common reference length that can be plotted along the x-axis. Each layer is originally a separate point shapefile with XYZ (UTM).

The point profile tool provides me with exactly what i want (see attached figure), but herein lies the problem:

If I construct a point profile for all my layers, there's (seemingly) no way to separate between the different layers. On the upside, the M-values (or length on the x-axis) is correct for each layer relative to the next in this scenario.
If I on the other hand construct point profiles for each layer separately, I cannot be sure that the M-values are correct relative to the other layers. The results are often close to correct, but for my purposes I need to be sure.

Ideally I would like either a permanent point profile where I simply change the input (i.e. point shapefile), or to be able to distinguish between the different point shapefile that are displayed within the point profile (not just colour them differently, but have them as separate datasets).

Disappointingly, I have not been able to extract the xyz point data information onto a permanent polyline. Probably due to the XYZ data being stored as points rather than a surface. Since they are from a 2D profile, it is not ideal (I think) to rasterize.

My brute alternative would be to create arbitrary points at either end of the profile and use these as targets or anchor points between which to project my point profile, but I'm sure there's a more sophisticated way of doing this.

In the figure, depth values are positive.


texts:
I am a bit of a GIS beginner here.

I've got an image mask in .jpg format that I'm trying to convert to a shapefile .shp format. To do so, I use the GDAL polygonize function.

This is what the input mask looks like:

I then use the following code to polygonize the image

sourceRaster = gdal.Open('./storage/processed/71ee8db7-d2b0-45e6-a232-e218d6977266/result.jpg')
band = sourceRaster.GetRasterBand(1)
bandArray = band.ReadAsArray()
outShapefile = "polygonized"
driver = ogr.GetDriverByName("ESRI Shapefile")
outDatasource = driver.CreateDataSource(outShapefile+ ".shp")
outLayer = outDatasource.CreateLayer("polygonized", srs=None)
newField = ogr.FieldDefn('MYFLD', ogr.OFTInteger)
outLayer.CreateField(newField)
gdal.Polygonize(band, None, outLayer, 0, [], callback=None )
outDatasource.Destroy()
sourceRaster = None

The output of the above code is the following:

As you may notice there are 2 problems that I see with the resulting shapefile:

It seems to be flipped upside down and
The contours of the objects seem to be extremely messy.

Would anyone have pointers on how the above issues could be resolved or improved?


texts: Features on a vector layer to have a scalable stroke?

texts:
I am trying to make some kind of line-drawing editor over OpenStreet map using OpenLayers. I am able to draw points, connect them into lines, and it all looks good, but if I unzoom, stroke width is the same as on previous zoom (instead of being smaller). And if I unzoom al the way up to 0, line width (stroke) is still the same.

Now, I made this work the way I want it using context on Style, but I don't like the way it works...

QUESTIONS:

Is there some kind of setting to make all lines scalable when I am changing zoom (adapt stroke width based on current zoom level)?

Can I set stroke width in meters or millimeters?


texts:
I am having some issues with the QGIS Hotspot Analysis plugin - after reading the user manual and instructions for correctly downloading it. I have tested it with the test data provided - the point file works correctly, but every time I try with the polygon file (which is what I really want the application for) - it comes up with a Python error.

Can anybody help me with this?

This is the error I get:

An error has occurred while executing Python code:

AttributeError: 'Point' object has no attribute 'bbox'
Traceback (most recent call last):
  File "/Users/Lydia/.qgis2/python/plugins/HotspotAnalysis/hotspot_analysis.py", line 576, in run
    w = pysal.queen_from_shapefile(myfilepath.split("|")[0])
  File "/Library/Python/2.7/site-packages/PySAL-1.13.0-py2.7.egg/pysal/weights/user.py", line 67, in queen_from_shapefile
    w = Queen.from_shapefile(shapefile, idVariable=idVariable)
  File "/Library/Python/2.7/site-packages/PySAL-1.13.0-py2.7.egg/pysal/weights/Contiguity.py", line 238, in from_shapefile
    w = cls(FileIO(filepath), ids=ids, **kwargs)
  File "/Library/Python/2.7/site-packages/PySAL-1.13.0-py2.7.egg/pysal/weights/Contiguity.py", line 185, in __init__
    criterion=criterion, method=method)
  File "/Library/Python/2.7/site-packages/PySAL-1.13.0-py2.7.egg/pysal/weights/Contiguity.py", line 364, in _build
    neighbor_data = ContiguityWeightsPolygons(polygons, wttype=wttype).w
  File "/Library/Python/2.7/site-packages/PySAL-1.13.0-py2.7.egg/pysal/weights/_contW_binning.py", line 68, in __init__
    self.do_weights()
  File "/Library/Python/2.7/site-packages/PySAL-1.13.0-py2.7.egg/pysal/weights/_contW_binning.py", line 99, in do_weights
    bbcache[i] = shpObj.bbox[:]
AttributeError: 'Point' object has no attribute 'bbox'

I have tried re-downloading the required Pysal, Numpy and SciPy multiple times, and I've noticed that with some of the versions provided on the KingChaos website the hotspots analysis plugin doesn't work at all, but with some just the points work. I cannot think of any way to get the polygon to work.


texts:
I have been doing an interpolation of rainfall data using QGIS and the interpolated data has a line which make the data uneven and the isohyets are being cut at the boundary line of 180 Degrees.
I know that this is due to the dateline passing through Fiji Islands but I need a fix for this so that the isohyets are not cut into two different maps
Attached is a QGIS map:


texts: How to set tile image formats for many layers using the Geoserver REST api

texts:
I have over 400 layers in my Geoserver layer catalog. I would like to turn on the pbf tile image format option for all of them. see image below:

Is there a way of accomplishing this using the Geoserver REST api? I haven't been able to find an examples and it's a little confusing whether I should be editing the Geoserver layer files or the GWC files inside of Geoserver, as the pbf tiles are served through GWC using TMS.


texts: Using regexp_match in PyQGIS script to select features?

texts:
I am learning to use Python scripts to automate tasks in my work. I am a beginner in Python and PyQGIS.

I would like to select entities in a layer using regexp_match. It works well in QGIS but I can't transpose it into the Python script.

Could someone tell me how to do it?

Here is my current code:

query = "regexp_match(\"COD\" ,'\d.\d\d')"
selshp = shp.getFeatures(QgsFeatureRequest().setFilterExpression(query))
shp.setSelectedFeatures([f.id() for f in selshp])

But no entities are selected while in QGIS I have 670 selected entities.


texts: Why does copy convert my Tiff raster value range?

texts:
Recently I have worked with some raster dataset. And I found there are different kind of raster dataset. Till now I have worked with grid type raster dataset and my add-in works fine with this type. But recently  I tried to work with a tiff type raster dataset and the tool didn't work properly. I couldn't find any problem with my code and after converting that tiff data to grid format also worked fine. So, I think data is valid and also my code is okay too.

Here is my question now: is there any difference between different type of raster from a programmer perspective? There I found another question like mine. But that answer is not from programmer's perspective and also an old thread.

I am using arcgis 10.0. I use arcpy and arcobjects.net both in my add-in.

EDIT:
After investigating a lot, I found some strange things. To describe those, need to describe the process.

Process Description:

I exported a raster in tiff format.
Copy that raster to a different folder.
I did Fill (Spatial Analyst) through arccpy on copy tiff raster.

the Fill (Spatial Analyst) tool gives a wrong output for copy tiff raster. And of course from my arcpy code also. And that was the reason behind posting this question. But suddenly I noticed that, the exported tiff raster gives correct output for Fill (Spatial Analyst) tool.

The value of the copy tiff raster is same as exported tiff raster but  the range of highest value and lowest value is changed. And most important thing is, when I clipped from copy tiff raster, then the clipped raster also gave correct answer.

What can be the problem with this raster? Why does it behave this way? Does this problem can occur any time?


texts: How to create proprietary tools for ArcGIS?

texts:
I want to build a some tools for ArcGIS. Toolboxes that I've seen are open source and run the scripts that reside in their src folder. However, I don't want to release the source code. After some googling (and thinking!), I came to these choices:

Releasing the .pyc files
Password-Protecting the tool
Implementing the core algorithm in an exe file and running it in my python code.

Are these options really helpful? What is the standard practice used for creating proprietary tools?


texts:
Can anybody please elaborate on QGIS' topology considering shared vertices of the type depicted in my screen cast?

The polygon in the picture is the same feature, with one node being shared at exactly the same position, without overlapping, leading to an intersection of the line-segments.

I assume this is supposed to be an invalid geometry, however I think it shouldn't.

How to get around this, if I want to retain the position of both vertices??

ps: WKT (sorry for the long one..) https://drive.google.com/open?id=0B2wAunwURQNsc1J4bS15WVBNSmM


texts: How to use GeoServer Web Processing Service (WPS) with OpenLayers and WFS?

texts: I wanted to try creating WPS service in geoserver on web application. I wanted to know reference links or some help regarding using WPS on web.


texts:
I am currently trying to add Point geometries into a table. My query is the following
    UPDATE postal_code.postal_codes
    SET    geom = ST_GeomFromText('POINT(' || lon || ' ' || lat || ')',4269);

I keep on getting a error message that says the following
ERROR:  parse error - invalid geometry
HINT:  "POINT("l" <-- parse error at position 8 within geometry
SQL state: XX000

Any tips on how to solve this error?


texts: How to create source and target ID columns for a linestring table in PostGIS?

texts:
I have table paths_3D which has column "the_geom". I need to create a new column source_id which will have starting points from the geom. This statement doesn't work:

ALTER TABLE paths_3d ADD COLUMN source_id AS SELECT *, startpoint(the_geom)FROM paths_3d;


texts: Create distance intervals along a Route + Cross Section

texts:
I believe I've done this before but years ago.
My goal is to make a X-Section of a line using a DEM. I want to create a Route (from a Polyline), give this route 1k intervals, and then "drape" it to my DEM. I then would like to create a cross section.
Does anyone have any idea how to do this?
I can see in 3D analyst I can digitise the line and create to create the x section but I am wanting to use the Route so I can show intervals along the line etc.
So far all I've done is create the route, I'm not sure how to break the line up into 1k intervals?


texts: Feature access not support symbology based in multiple fields in sharing service (ArcGIS, ArcGIS Desktop, ERROR 00085)

texts:
Error 00085 : Layer uses an unsupported renderer

In the service publication -> Capabilities -> feature access checked! : does not support symbology based in multiple fields!

Is there an approach to symbolize with the use of multiple columns? Avoiding the creation of a combination column between the fields concerned?

Any idea ?


texts: Density analysis with two polygons in ArcGIS Pro

texts:
I'm a Norwegian student currently conducting a series of site analyzes for a city. In that context I wish to create a building density map but struggle a bit to find out how.
I have made a fishnet polygon of 50x50 meter and wish to find out how much built area there is in each of these squares. My goal is to color the squares according to how much percent of the squares are built area. Both the fishnet and the buildings are polygons and are editable. Please see the image.
Can anyone help me perform the analysis?


texts: Using 'ogr2ogr' algorithm in QGIS to transform SHP to GPX

texts:
So I am trying to convert a LineString shapefile into GPX using the 'gdalogr:ogr2ogr' algorithm in a QGIS python plugin.

The problem is that I alway get routes instead of tracks, even if I specify the option 'FORCE_GPX_TRACK=YES'. The input is actually a LineString, not a MultiLineString (by default, LineString are created into the route layer). But the 'FORCE_GPX_TRACK' option is supposed to create it as a track...

Here is the code:

processing.runalg("gdalogr:ogr2ogr",inputf,16,'FORCE_GPX_TRACK=YES',self.GUIControl.output_path + os.sep + "GPX" + os.sep + filename)

EDIT:

Maybe I should mention that I am trying this on QGIS 2.4 on Linux (debian)

I tried 'gdalogr:convertformat' on QGIS 2.12 on Windows and it wrote the GPX file with the correct geometries, as tracks. But, there are no attributes though. Maybe I should use '-select field_list' option after -lco ?

I will try it tommorrow, because i'm on my windows machine right now. I just wanted to post an update of my problem to let you know i'm still alive :P


texts:
I have been mapping old tracks with Garmin 64s. I want to know how to take a group of way-points that belong to edited/cleaned tracks in my Base-camp and convert them to a format (csv? txt?) that will allow me to share these with another user for upload to his device or computer and into a survey plan, preferably in an excel spreadsheet. Is that the right way to go about it?

I've been told about various software (gpsBabel, GSAK) that are supposed to do this but I do not know the correct process/procedure in applying this software. It is new to me and if you can help please do in real layman's terms, step by step process and correct language formatting, just to get me started.