Coder Social home page Coder Social logo

Comments (11)

sevar83 avatar sevar83 commented on June 14, 2024

from android-spatialite.

luis901101 avatar luis901101 commented on June 14, 2024
  1. The intersects function does work, in fact the example query posted in the issue returns 18 rows.
  2. "umlaut" ??? don't understand what you mean??? if you are referring to the like '%desagü%' I tested with other conditions and the intersection function still doesn't work.

from android-spatialite.

sevar83 avatar sevar83 commented on June 14, 2024

from android-spatialite.

luis901101 avatar luis901101 commented on June 14, 2024

What I need to do is a geocoding search using spatialite, that's why I need the intersection function, I made a small spatialite database for testing purposes, cause my app database is really big. This database has an only table with 18 rows representing streets, each row has a name and a MULTILINESTRING geometry.

Link to download database: https://mega.nz/#!BY8QEI5Z!FSW6rQkBHQk8LMnNq6ph5TwCN7sUJy0a6tEsqmzfO00

Running this query using spatialite_gui app:

select name, geometry, astext(geometry) textgeometry, astext(intersection(geometry, (select geometry
from ln_data where id=62175
))) as textintersection
from ln_data
where 
intersects(geometry, (select geometry
from ln_data where id=62175
))

will return 18 rows which are the intersections of the street with id=62175 and the rest of the streets in database including the same. In the spatialite_gui app this query results is OK, 18 rows and each column has a non null value as expected, but using android_spatialite the 18 rows has a null value in the conlumn of textintersection.

This is the java code I used:

SQLiteDatabase spatialiteDatabase = SQLiteDatabase.openDatabase("/sdcard/map/test.sqlite", null, SQLiteDatabase.OPEN_READONLY);

Cursor cursor = spatialiteDatabase.rawQuery("select name, geometry, astext(geometry) textgeometry, astext(intersection(geometry, (select geometry\n" + "from ln_data where id=62175\n" + "))) as textintersection\n" + "from ln_data\n" + "where \n" + "intersects(geometry, (select geometry\n" + "from ln_data where id=62175\n" + "))\n", null);

if(cursor != null && cursor.moveToFirst())
{
    do
    {
        String name = cursor.getString(cursor.getColumnIndex("name"));
        byte[] geometry = cursor.getBlob(cursor.getColumnIndex("geometry"));
        String textgeometry = cursor.getString(cursor.getColumnIndex("textgeometry"));
        String textintersection = cursor.getString(cursor.getColumnIndex("textintersection"));
        Log.d("test", "name: " + name);
        Log.d("test", "geometry: " + geometry);
        Log.d("test", "textgeometry: " + textgeometry);
        Log.d("test", "textintersection: " + textintersection);
    }while(cursor.moveToNext());
}

spatialiteDatabase.close();

So this query uses 3 spatialite functions which are: astext(...), intersection(...) and intersects(...), and I have 18 rows as result, so the intersects(...) function is working OK, and the astext(...) function is working OK, but the intersection(...) function is not working at all.

I hope this is enough to reproduce the problem I've been facing.

Thanks in advance.

from android-spatialite.

sevar83 avatar sevar83 commented on June 14, 2024

from android-spatialite.

luis901101 avatar luis901101 commented on June 14, 2024

I checked and the Spatialite version is the same, the GEOS version it is different, it is the v3.5.0 different to the v3.4.2 included in the lib... But i don't think the problem is a missing function cause there is not any Sqlite Exception about any invalid function...

from android-spatialite.

sevar83 avatar sevar83 commented on June 14, 2024

from android-spatialite.

luis901101 avatar luis901101 commented on June 14, 2024

Ok thanks, I will be aware.

from android-spatialite.

yuechaoyue666 avatar yuechaoyue666 commented on June 14, 2024

Is this problem solved?

from android-spatialite.

luis901101 avatar luis901101 commented on June 14, 2024

Is this problem solved?

No idea, it has been a long time

from android-spatialite.

yuechaoyue666 avatar yuechaoyue666 commented on June 14, 2024

Is it possible that intersects=1 but intersection=null?

from android-spatialite.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.