Tag Info

Hot answers tagged

4

You can simplify the whole thing by using coalesce, which selects the first non-null item in a list, in this case, either the nearest point to you search point, (28.959495,41.019913), or the point itself. with input_geom (geom) as (select st_setsrid(st_makepoint(28.959495,41.019913), 4326)) select coalesce( (select st_closestpoint(pts.the_geom, ...


2

Use DPD IN ('Gas','Oil','') instead of multiple OR


2

In QGIS you could try to sanitize your column with spaced characters by using regexp_replace( 'Some street 12 A', '\\s([0-9]+)\\s\w', ' \\1') via Field calculator. You will have to replace 'Some street 12 A' with your column: it should be working. Hope this helps.


2

In SQL, assuming your database supports regular expressions, you could do something like the following (postGres example). Something similar in oracle should also work. T-SQL is a bit more tricky as it doesn't have regular expressions. UPDATE someTable SET someCol = regexp_replace(someCol,'(\m[0-9]+)\M[ ]+\m([a-z]+)\M','\1\2','gi') WHERE someCol ~* ...


2

If you want to have different visualisations but only modifying your query params, for instance because a filter changed and you want to change your where from WHERE somefield = 'x' to WHERE somefield = 'y', probably you want to have a look at the named maps + templates functionality provided by the Maps API. That allows you to create visualisations without ...


2

Do you mean errors using the Editor?? Otherwise, if you are using for example CartoDB.js, you could check and debug the requests made by browser. For example, with Google Chrome, you could open Google Dev Tools and look at Network tab. There, you could check the errors request (red). And there, you can find the error returned by the database.


1

Yes, sort of. You can't send arbitrary SQL to GeoServer, but you can use a subset of SQL with the CQL_FILTER parameter. http://docs.geoserver.org/latest/en/user/tutorials/cql/cql_tutorial.html With CQL you can do filtering including intersects and attribute filtering. For more complicated queries you might have to write a custom WPS process.


1

The answer to your question depends on the database you are working with. For File Geodatabase feature classes and tables you can use the Cast operator. For example, this will work in a File Geodatabase: Service_Day <> CAST(Region AS FLOAT) You can also convert a numeric value to a string and compare it: CAST(Service_Day AS VARCHAR(1)) <> ...


1

If you want to clear the querys, you need to click on the option "clear view" in the green bar that appears in the data view: See image attachment: About your second question (adding/deleting fields from tables), you need to click on the option "Add column". It is at the right menu (in Data View), the last option. I attach an image too:


1

Yes, you can do it with CartoDB.js. This link will help you: http://bl.ocks.org/xavijam/378c6dc0d43654280757


1

I use squel.js to create SQL queries in javascript. It's pretty straightforward + lightweight to boot: http://hiddentao.github.io/squel/


1

As per @FelixIP's answer, use an IN operator in your where clause. The multivalue parameter is passed as a single semicolon delimted string, i.e. "value1;value2;value3". To convert this to the required format for the IN operator use python split/list comprehension/join or replacement. split/list comprehension/join: fields = arcpy.GetParameterAsText(0) ...


1

(Credit to @Russell at ISC for the use of the modulo operator.) We have a table in SQL Server with a column of geography data type, called [GeoCoor]. This is how we convert to degrees, minutes, and seconds: SELECT [GeoCoor].[Lat] as [DecimalLatitude], floor(ABS([GeoCoor].[Lat]))*(CASE WHEN [GeoCoor].[Lat] < 0 then -1 ELSE 1 END) as [LatDegrees], ...


1

Just as a reminder: also make sure the classes or tables are part of the same geodatabase AND make sure the keyfields on which the join will be operated are of the same type.


1

You could try with a replace in Python, removing all [0...9] followed with a space. def RemoveWhiteAfterNumber(addressField): a = addressField for i in range(10): a = a.replace( str(i) +" ", str(i)) return a RemoveWhiteAfterNumber(!addressField!)


1

Does every address end in the form '12 A' or '12A'? If so, you could split on whitespace (the default, in python anyway), then test the last element to see whether it contains digits or not. Combine the last two elements if the last element is a plain alpha character. This could also work testing the last element for length, provided the last element of an ...



Only top voted, non community-wiki answers of a minimum length are eligible