Search Rout

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Search Rout

Siline
Hi,

I am trying to configure for search rout.
on the search interface, I click on Search, but no result or any action.
Please help?

Thanks!

Bellow is my configuration.
config.yml

            db1_5:
                driver:   %db1_5_database_driver%
                host:     %db1_5_database_host%
                port:     %db1_5_database_port%
                dbname:   %db1_5_database_name%
                path:     %db1_5_database_path%
                user:     %db1_5_database_user%
                password: %db1_5_database_password%
                persistent: true
                charset:  UTF8
                logging: %kernel.debug%
                profiling: %kernel.debug%

     
parameters.yml
parameters:
    database_driver:   pdo_sqlite
    database_host:     ~
    database_port:     ~
    database_name:     ~
    database_path:     %kernel.root_dir%/db/demo.sqlite
    database_user:     ~
    database_password: ~

    db1_5_database_driver:   pdo_mysql
    db1_5_database_host:     localhost
    db1_5_database_port:     3306
    db1_5_database_name:    db1_5
    db1_5_database_path:     ~
    db1_5_database_user:     root
    db1_5_database_password: ~

This is my configuration on search element:

class: Mapbender\CoreBundle\Component\SQLSearchEngine
class_options:
    connection: db1_5
    relation: line_test
    attributes:
      - line_id
      - line_ref_num
      - line_name
     geometry_attribute: line_geo
form:
   line_ref_num:
      type: text
      options:
          required: false
          label: 'Line Number'
          attr:
              data-autocomplete: on
      compare: ilike
results:
    view: table
    count: true
    headers:
      line_id: 'ID'
      line_ref_num: 'Line Number'
      line_name: 'Name'
    callback:
      event: click
      options:
          buffer: 100
          minScale: null
          maxScale: null
    styleMap:
      default:
          strokeColor: '#00ff00'
          strokeOpacity: 1
          fillOpacity: 0
      select:
          strokeColor: '#ff0000'
          fillColor: '#ff0000'
          fillOpacity: 0.8
      temporary:
          strokeColor: '#0000ff'
          fillColor: '#0000ff'
          fillOpacity: 1



--
Sent from: http://osgeo-org.1560.x6.nabble.com/mapbender-users-f4220788.html
_______________________________________________
Mapbender_users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapbender_users
Reply | Threaded
Open this post in threaded view
|

Re: Search Rout

Astrid Emde (WhereGroup)
Hello Siline,

your configuration looks fine. Did you also try with a PostgreSQL table
(that should work for sure).

Please also check the developer mode to find out whether the connection
works fine.

http://server/mapbender/app_dev.php

With F12 it will show you if problems occur.

Empty cache.

Export web: app/console assests:install web

Astrid

Am 2020-01-15 10:12, schrieb Siline:

> Hi,
>
> I am trying to configure for search rout.
> on the search interface, I click on Search, but no result or any
> action.
> Please help?
>
> Thanks!
>
> Bellow is my configuration.
> config.yml
>
>             db1_5:
>                 driver:   %db1_5_database_driver%
>                 host:     %db1_5_database_host%
>                 port:     %db1_5_database_port%
>                 dbname:   %db1_5_database_name%
>                 path:     %db1_5_database_path%
>                 user:     %db1_5_database_user%
>                 password: %db1_5_database_password%
>                 persistent: true
>                 charset:  UTF8
>                 logging: %kernel.debug%
>                 profiling: %kernel.debug%
>
>
> parameters.yml
> parameters:
>     database_driver:   pdo_sqlite
>     database_host:     ~
>     database_port:     ~
>     database_name:     ~
>     database_path:     %kernel.root_dir%/db/demo.sqlite
>     database_user:     ~
>     database_password: ~
>
>     db1_5_database_driver:   pdo_mysql
>     db1_5_database_host:     localhost
>     db1_5_database_port:     3306
>     db1_5_database_name:    db1_5
>     db1_5_database_path:     ~
>     db1_5_database_user:     root
>     db1_5_database_password: ~
>
> This is my configuration on search element:
>
> class: Mapbender\CoreBundle\Component\SQLSearchEngine
> class_options:
>     connection: db1_5
>     relation: line_test
>     attributes:
>       - line_id
>       - line_ref_num
>       - line_name
>      geometry_attribute: line_geo
> form:
>    line_ref_num:
>       type: text
>       options:
>           required: false
>           label: 'Line Number'
>           attr:
>               data-autocomplete: on
>       compare: ilike
> results:
>     view: table
>     count: true
>     headers:
>       line_id: 'ID'
>       line_ref_num: 'Line Number'
>       line_name: 'Name'
>     callback:
>       event: click
>       options:
>           buffer: 100
>           minScale: null
>           maxScale: null
>     styleMap:
>       default:
>           strokeColor: '#00ff00'
>           strokeOpacity: 1
>           fillOpacity: 0
>       select:
>           strokeColor: '#ff0000'
>           fillColor: '#ff0000'
>           fillOpacity: 0.8
>       temporary:
>           strokeColor: '#0000ff'
>           fillColor: '#0000ff'
>           fillOpacity: 1
>
>
>
> --
> Sent from:
> http://osgeo-org.1560.x6.nabble.com/mapbender-users-f4220788.html
> _______________________________________________
> Mapbender_users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/mapbender_users

--
Mit freundlichen Grüßen

Astrid Emde
GIS-Consultant


  -----------------------------------
  Aufwind durch Wissen!
  Qualifizierte Open-Source-Schulungen
  bei der www.foss-academy.com
  -----------------------------------

   Astrid Emde
   WhereGroup GmbH
   Eifelstraße 7
   53119 Bonn
   Germany

   Fon: +49(0)228 90 90 38 - 22
   Fax: +49(0)228 90 90 38 - 11

   [hidden email]
   www.wheregroup.com

   Folgen Sie der WhereGroup auf twitter:
http://twitter.com/WhereGroup_com

Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885
-------------------------------
_______________________________________________
Mapbender_users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapbender_users
Reply | Threaded
Open this post in threaded view
|

Re: Search Rout

Siline
This post was updated on .
Thank so much Astrid.

Do you mean Search Router element works well only PostgreSQL?
I have to work with MySQL, because my map db system is integrated with other
system.

After click search button, it should be able to show "Not Found" or "Found". but search is nothing come up.

I go to Development mode, it seems no connection error.
please take a look on the screenshot.
<http://osgeo-org.1560.x6.nabble.com/file/t385793/search_errror.png



--
Sent from: http://osgeo-org.1560.x6.nabble.com/mapbender-users-f4220788.html
_______________________________________________
Mapbender_users mailing list
Mapbender_users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapbender_users
Reply | Threaded
Open this post in threaded view
|

Re: Search Rout

Astrid Emde (WhereGroup)
Hello Siline,

honestly I am not sure about MySQL.

So please check F12 and Tab Network for requests on search. If the
connection does not work it would be reoprted here.

Astrid

Am 2020-01-16 03:14, schrieb Siline:

> Thank so much Astrid.
>
> Do you mean Search Router element works well only PostgreSQL?
> I have to work with MySQL, because map db system is integrated with
> other
> system.
>
> I go to Development mode, it seems no connection error.
> please take a look on the screenshot.
> <http://osgeo-org.1560.x6.nabble.com/file/t385793/search_errror.png>
>
>
>
> --
> Sent from:
> http://osgeo-org.1560.x6.nabble.com/mapbender-users-f4220788.html
> _______________________________________________
> Mapbender_users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/mapbender_users

--
Mit freundlichen Grüßen

Astrid Emde
GIS-Consultant


  -----------------------------------
  Aufwind durch Wissen!
  Qualifizierte Open-Source-Schulungen
  bei der www.foss-academy.com
  -----------------------------------

   Astrid Emde
   WhereGroup GmbH
   Eifelstraße 7
   53119 Bonn
   Germany

   Fon: +49(0)228 90 90 38 - 22
   Fax: +49(0)228 90 90 38 - 11

   [hidden email]
   www.wheregroup.com

   Folgen Sie der WhereGroup auf twitter:
http://twitter.com/WhereGroup_com

Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885
-------------------------------
_______________________________________________
Mapbender_users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapbender_users
Reply | Threaded
Open this post in threaded view
|

Re: Search Rout

Siline
This post was updated on .
Sorry to disturb you gain! I really want it works.

Here is the error message on Tab Network. Could you help to figure out what
is the problem?




--
Sent from: http://osgeo-org.1560.x6.nabble.com/mapbender-users-f4220788.html
_______________________________________________
Mapbender_users mailing list
Mapbender_users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapbender_users
Reply | Threaded
Open this post in threaded view
|

Re: Search Rout

Siline
Hello,

I found error, but I still can't fix the error. please help.
This is error:
An exception occurred while executing 'SELECT t.`line_id`, t.`line_ref_num`,
t.`chainage`, t.`line_name`, ST_AsGeoJSON(ST_Transform(t.`line_wkt`,
?::int)) as geom FROM gis_line_t1 t WHERE (t.line_ref_num LIKE ?) AND
(ST_Transform(ST_SetSRID(ST_MakeBox2D(ST_Point(?, ?), ST_Point(?, ?)), ?),
ST_Srid(t.`line_wkt`)) && t.`line_wkt`)' with params [32648, "%0806T1001%",
5579.905, 1088581.723, 1029359.857, 1650396.77, 32648]:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in
your SQL syntax; check the manual that corresponds to your MariaDB server
version for the right syntax to use near '::int)) as geom FROM gis_line_t1 t
WHERE (t.line_ref_num LIKE '%0806T1001%' at line 1

Best,
Siline



--
Sent from: http://osgeo-org.1560.x6.nabble.com/mapbender-users-f4220788.html
_______________________________________________
Mapbender_users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapbender_users
Reply | Threaded
Open this post in threaded view
|

Re: Search Rout

Astrid Emde (WhereGroup)
Hello Siline,

please add a text column that contains your line_ref_num and search with
this column instead with line_ref_num.

Mapbender can only handle text. So maybe this will help.

Astrid

Am 2020-01-17 08:34, schrieb Siline:

> Hello,
>
> I found error, but I still can't fix the error. please help.
> This is error:
> An exception occurred while executing 'SELECT t.`line_id`,
> t.`line_ref_num`,
> t.`chainage`, t.`line_name`, ST_AsGeoJSON(ST_Transform(t.`line_wkt`,
> ?::int)) as geom FROM gis_line_t1 t WHERE (t.line_ref_num LIKE ?) AND
> (ST_Transform(ST_SetSRID(ST_MakeBox2D(ST_Point(?, ?), ST_Point(?, ?)),
> ?),
> ST_Srid(t.`line_wkt`)) && t.`line_wkt`)' with params [32648,
> "%0806T1001%",
> 5579.905, 1088581.723, 1029359.857, 1650396.77, 32648]:
>
> SQLSTATE[42000]: Syntax error or access violation: 1064 You have an
> error in
> your SQL syntax; check the manual that corresponds to your MariaDB
> server
> version for the right syntax to use near '::int)) as geom FROM
> gis_line_t1 t
> WHERE (t.line_ref_num LIKE '%0806T1001%' at line 1
>
> Best,
> Siline
>
>
>
> --
> Sent from:
> http://osgeo-org.1560.x6.nabble.com/mapbender-users-f4220788.html
> _______________________________________________
> Mapbender_users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/mapbender_users

--
Mit freundlichen Grüßen

Astrid Emde
GIS-Consultant


  -----------------------------------
  Aufwind durch Wissen!
  Qualifizierte Open-Source-Schulungen
  bei der www.foss-academy.com
  -----------------------------------

   Astrid Emde
   WhereGroup GmbH
   Eifelstraße 7
   53119 Bonn
   Germany

   Fon: +49(0)228 90 90 38 - 22
   Fax: +49(0)228 90 90 38 - 11

   [hidden email]
   www.wheregroup.com

   Folgen Sie der WhereGroup auf twitter:
http://twitter.com/WhereGroup_com

Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885
-------------------------------
_______________________________________________
Mapbender_users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapbender_users
Reply | Threaded
Open this post in threaded view
|

Re: Search Rout

Siline
This post was updated on .
Hello,

My original datatype for line_ref_num is varchar(10), I changed to text. I
still got the same error.
Then I try the query in PhPmyadmin "SELECT t.`line_id`, t.`line_ref_num`,
t.`chainage`, t.`line_name`, t.`line_class_en`,
ST_AsGeoJSON(ST_Transform(t.`line_wkt`,4326)) as geom FROM gis_line_t2
t WHERE (t.line_class_en LIKE '%road%')". I got this error ST_Transform does
not exist.

May be the MySQL does not understand function ST_Transform.
Could you please tell me which file that i can edit to remove ST_Transform?
and any suggestion for replace this function for mySQL?

Best,
Siline



--
Sent from: http://osgeo-org.1560.x6.nabble.com/mapbender-users-f4220788.html
_______________________________________________
Mapbender_users mailing list
Mapbender_users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapbender_users