Re: [sqlalchemy] live access to postgis database to use in ExtJS, OpenLayers, etc
"It sounds like you are trying to do at least 6 quite complicated things all at once, without really understanding any of them. This will not be easy." Sigh. The story of my life in one sentence. On Tue, Oct 2, 2012 at 8:43 AM, Simon King wrote: > On Mon, Oct 1, 2012 at 11:38 PM, Gery . wrote: >> >> thanks but I want to use that live access to search at first through >> ExtJS/GeoExtJS/OpenLayers and through them there is only a url available >> (protocol HTTP), I also need to get the data as GeoJSON, so I think >> GeoAlchemy might not be the right solution, I think. If I'm wrong, please >> I'd love some points about it, thanks. >> > > It sounds like you are trying to do at least 6 quite complicated > things all at once, without really understanding any of them. This > will not be easy. > > 1. The client side of your application is presumably written in > Javascript and HTML, using javascript libraries such as ExtJS and > OpenLayers. You need to fully understand how these work. > > 2. The application will then make HTTP requests to a web server. You > need to understand at least the basics of HTTP. > > 3. The web server might be a single python script, or it could be > something running behind Apache. You need to understand your web > server. > > 4. The server side of your application might be using any of a number > of libraries to connect to the web server (such as > Django/Pyramid/Flask/cgi/mod_wsgi etc.). You need to understand > whatever mechanism your application is using to speak HTTP. > > 5. Your application can use SQLAlchemy and GeoAlchemy to retrieve data > from postgis into Python data structures. You will need to understand > postgis, SQLAlchemy, GeoAlchemy and Python. > > 6. Your application can then convert those Python data structures into > GeoJSON. You will need to understand GeoJSON. > > The SQLAlchemy mailing list can help you with exactly one part of this > (step 5). SQLAlchemy (and GeoAlchemy) is perfectly capable of querying > multiple tables and retrieving results. But how you accept the HTTP > request, and how you pass the results back, are completely outside the > scope of this list and I'm afraid you are unlikely to find much help > here with it. > > Sorry I can't be more help, > > Simon > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalchemy@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
RE: [sqlalchemy] live access to postgis database to use in ExtJS, OpenLayers, etc
thanks a lot for the answer, I didn't expect that, nice from you. I'll take a look at that and see what I keep doing, in fact I have set all the backend and client part, the only thing I need is to "leave the door open" to my pg tables, so I can (at first) search inside them and plot the features in OL. Through the postgis_geojson.php script and extjs I'm trying that because it allows what I need, it's just to find a way to pass the two variables I need and overwrite the default ext-comp104 of the xtype. But yes, this is beyond the scope of this forum. BTW my question (live access to postgis database) was related to what the MapFish guys did in the MapFish demo (great project btw, these guys are geniuses), they just use "an url" to do the search function, I know there is "bunch of things" behind (Pylons, etc), but I just wanted to know if it's possible to do it easier than that, perhaps with just SqlAlchemy, but I think a RESTful framework could work also. Many thanks also Michael for your email, helpful as always. Cheers, Gery __ Piensa en el medio ambiente - mantenlo en la pantalla. NO lo imprimas si NO es necesario. Think green - keep it on the screen. Do NOT print if it is NOT necessary. Denken Sie an die Umwelt - bewahren Sie es auf dem Bildschirm. Drucken Sie NICHT, wenn es NICHT notwendig ist. > From: si...@simonking.org.uk > Date: Wed, 3 Oct 2012 10:18:47 +0100 > Subject: Re: [sqlalchemy] live access to postgis database to use in ExtJS, > OpenLayers, etc > To: sqlalchemy@googlegroups.com > > On Tue, Oct 2, 2012 at 7:26 PM, Gery . wrote: > > > > thanks for the email, it seems that you know a lot about this stuff, it'd be > > great if you could share what you know so in that way we will learn from > > you, but as expected you won't do it, your "Sorry I can't be more help," is > > very clear as always. But hey anyway, I appreciate that you demostrate how > > you really are. > > > > I was just trying to demonstrate that what you are trying to do is > complicated, with a lot of interactions between different > technologies. You need to break it down into smaller tasks that you > can test, and get each piece working before starting on the next. > > I recommend that you start by taking the example GeoJSON file from > http://www.geojson.org/geojson-spec.html#examples and saving that on > your web server. Change your javascript to load that file, and check > that you can actually see the data from the file in your application. > If you can't get this working you'll need to talk to someone who knows > about OpenLayers (I don't know anything about it) > > Once you've done that, put a python script in the cgi-bin directory of > your web server that looks something like this: > > -- > #!/usr/bin/env python > # CGI scripts start by sending the HTTP headers. The only > # one you absolutely need is the Content-type header. > # I'm not sure if OpenLayers requires a specific content type > # so you may need to experiment here. > print "Content-type: application/json" > > # In HTTP, a blank line separates the headers from the body > # of the response > print "" > > # Anything else that you print forms the body of the response. > # In this case, we just want to send the example GeoJSON data. > print """ > > """ > -- > > Visit http://localhost/cgi-bin/yourscript.py in your web browser and > verify that you see the GeoJSON data. If that doesn't work, you'll > probably need to contact the Python mailing list. > > Update your Javascript to point to that URL. You should still be able > to see the data within your application. > > Once you've got all that working, you can start adding SQLAlchemy into > the python script. Let us know when you get there and we might be able > to help. > > Simon > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalchemy@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
Re: [sqlalchemy] live access to postgis database to use in ExtJS, OpenLayers, etc
On Tue, Oct 2, 2012 at 7:26 PM, Gery . wrote: > > thanks for the email, it seems that you know a lot about this stuff, it'd be > great if you could share what you know so in that way we will learn from > you, but as expected you won't do it, your "Sorry I can't be more help," is > very clear as always. But hey anyway, I appreciate that you demostrate how > you really are. > I was just trying to demonstrate that what you are trying to do is complicated, with a lot of interactions between different technologies. You need to break it down into smaller tasks that you can test, and get each piece working before starting on the next. I recommend that you start by taking the example GeoJSON file from http://www.geojson.org/geojson-spec.html#examples and saving that on your web server. Change your javascript to load that file, and check that you can actually see the data from the file in your application. If you can't get this working you'll need to talk to someone who knows about OpenLayers (I don't know anything about it) Once you've done that, put a python script in the cgi-bin directory of your web server that looks something like this: -- #!/usr/bin/env python # CGI scripts start by sending the HTTP headers. The only # one you absolutely need is the Content-type header. # I'm not sure if OpenLayers requires a specific content type # so you may need to experiment here. print "Content-type: application/json" # In HTTP, a blank line separates the headers from the body # of the response print "" # Anything else that you print forms the body of the response. # In this case, we just want to send the example GeoJSON data. print """ """ -- Visit http://localhost/cgi-bin/yourscript.py in your web browser and verify that you see the GeoJSON data. If that doesn't work, you'll probably need to contact the Python mailing list. Update your Javascript to point to that URL. You should still be able to see the data within your application. Once you've got all that working, you can start adding SQLAlchemy into the python script. Let us know when you get there and we might be able to help. Simon -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
Re: [sqlalchemy] live access to postgis database to use in ExtJS, OpenLayers, etc
On Oct 2, 2012, at 2:26 PM, Gery . wrote: > > thanks for the email, it seems that you know a lot about this stuff, it'd be > great if you could share what you know so in that way we will learn from you, > but as expected you won't do it, your "Sorry I can't be more help," is very > clear as always. But hey anyway, I appreciate that you demostrate how you > really are. If I'm reading this correctly, this is uncalled for - Simon is an incredibly helpful person, and on the SQLAlchemy list you'll get all the help you need in using SQLAlchemy and relational databases. For general Python assistance you can try IRC channel #python, the comp.lang.python lists, and StackOverflow. > > > > __ > Piensa en el medio ambiente - mantenlo en la pantalla. NO lo imprimas si NO > es necesario. > Think green - keep it on the screen. Do NOT print if it is NOT necessary. > Denken Sie an die Umwelt - bewahren Sie es auf dem Bildschirm. Drucken Sie > NICHT, wenn es NICHT notwendig ist. > > > > From: si...@simonking.org.uk > > Date: Tue, 2 Oct 2012 14:43:21 +0100 > > Subject: Re: [sqlalchemy] live access to postgis database to use in ExtJS, > > OpenLayers, etc > > To: sqlalchemy@googlegroups.com > > > > On Mon, Oct 1, 2012 at 11:38 PM, Gery . wrote: > > > > > > thanks but I want to use that live access to search at first through > > > ExtJS/GeoExtJS/OpenLayers and through them there is only a url available > > > (protocol HTTP), I also need to get the data as GeoJSON, so I think > > > GeoAlchemy might not be the right solution, I think. If I'm wrong, please > > > I'd love some points about it, thanks. > > > > > > > It sounds like you are trying to do at least 6 quite complicated > > things all at once, without really understanding any of them. This > > will not be easy. > > > > 1. The client side of your application is presumably written in > > Javascript and HTML, using javascript libraries such as ExtJS and > > OpenLayers. You need to fully understand how these work. > > > > 2. The application will then make HTTP requests to a web server. You > > need to understand at least the basics of HTTP. > > > > 3. The web server might be a single python script, or it could be > > something running behind Apache. You need to understand your web > > server. > > > > 4. The server side of your application might be using any of a number > > of libraries to connect to the web server (such as > > Django/Pyramid/Flask/cgi/mod_wsgi etc.). You need to understand > > whatever mechanism your application is using to speak HTTP. > > > > 5. Your application can use SQLAlchemy and GeoAlchemy to retrieve data > > from postgis into Python data structures. You will need to understand > > postgis, SQLAlchemy, GeoAlchemy and Python. > > > > 6. Your application can then convert those Python data structures into > > GeoJSON. You will need to understand GeoJSON. > > > > The SQLAlchemy mailing list can help you with exactly one part of this > > (step 5). SQLAlchemy (and GeoAlchemy) is perfectly capable of querying > > multiple tables and retrieving results. But how you accept the HTTP > > request, and how you pass the results back, are completely outside the > > scope of this list and I'm afraid you are unlikely to find much help > > here with it. > > > > Sorry I can't be more help, > > > > Simon > > > > -- > > You received this message because you are subscribed to the Google Groups > > "sqlalchemy" group. > > To post to this group, send email to sqlalchemy@googlegroups.com. > > To unsubscribe from this group, send email to > > sqlalchemy+unsubscr...@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/sqlalchemy?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalchemy@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
RE: [sqlalchemy] live access to postgis database to use in ExtJS, OpenLayers, etc
thanks for the email, it seems that you know a lot about this stuff, it'd be great if you could share what you know so in that way we will learn from you, but as expected you won't do it, your "Sorry I can't be more help," is very clear as always. But hey anyway, I appreciate that you demostrate how you really are. __ Piensa en el medio ambiente - mantenlo en la pantalla. NO lo imprimas si NO es necesario. Think green - keep it on the screen. Do NOT print if it is NOT necessary. Denken Sie an die Umwelt - bewahren Sie es auf dem Bildschirm. Drucken Sie NICHT, wenn es NICHT notwendig ist. > From: si...@simonking.org.uk > Date: Tue, 2 Oct 2012 14:43:21 +0100 > Subject: Re: [sqlalchemy] live access to postgis database to use in ExtJS, > OpenLayers, etc > To: sqlalchemy@googlegroups.com > > On Mon, Oct 1, 2012 at 11:38 PM, Gery . wrote: > > > > thanks but I want to use that live access to search at first through > > ExtJS/GeoExtJS/OpenLayers and through them there is only a url available > > (protocol HTTP), I also need to get the data as GeoJSON, so I think > > GeoAlchemy might not be the right solution, I think. If I'm wrong, please > > I'd love some points about it, thanks. > > > > It sounds like you are trying to do at least 6 quite complicated > things all at once, without really understanding any of them. This > will not be easy. > > 1. The client side of your application is presumably written in > Javascript and HTML, using javascript libraries such as ExtJS and > OpenLayers. You need to fully understand how these work. > > 2. The application will then make HTTP requests to a web server. You > need to understand at least the basics of HTTP. > > 3. The web server might be a single python script, or it could be > something running behind Apache. You need to understand your web > server. > > 4. The server side of your application might be using any of a number > of libraries to connect to the web server (such as > Django/Pyramid/Flask/cgi/mod_wsgi etc.). You need to understand > whatever mechanism your application is using to speak HTTP. > > 5. Your application can use SQLAlchemy and GeoAlchemy to retrieve data > from postgis into Python data structures. You will need to understand > postgis, SQLAlchemy, GeoAlchemy and Python. > > 6. Your application can then convert those Python data structures into > GeoJSON. You will need to understand GeoJSON. > > The SQLAlchemy mailing list can help you with exactly one part of this > (step 5). SQLAlchemy (and GeoAlchemy) is perfectly capable of querying > multiple tables and retrieving results. But how you accept the HTTP > request, and how you pass the results back, are completely outside the > scope of this list and I'm afraid you are unlikely to find much help > here with it. > > Sorry I can't be more help, > > Simon > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalchemy@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
Re: [sqlalchemy] live access to postgis database to use in ExtJS, OpenLayers, etc
On Mon, Oct 1, 2012 at 11:38 PM, Gery . wrote: > > thanks but I want to use that live access to search at first through > ExtJS/GeoExtJS/OpenLayers and through them there is only a url available > (protocol HTTP), I also need to get the data as GeoJSON, so I think > GeoAlchemy might not be the right solution, I think. If I'm wrong, please > I'd love some points about it, thanks. > It sounds like you are trying to do at least 6 quite complicated things all at once, without really understanding any of them. This will not be easy. 1. The client side of your application is presumably written in Javascript and HTML, using javascript libraries such as ExtJS and OpenLayers. You need to fully understand how these work. 2. The application will then make HTTP requests to a web server. You need to understand at least the basics of HTTP. 3. The web server might be a single python script, or it could be something running behind Apache. You need to understand your web server. 4. The server side of your application might be using any of a number of libraries to connect to the web server (such as Django/Pyramid/Flask/cgi/mod_wsgi etc.). You need to understand whatever mechanism your application is using to speak HTTP. 5. Your application can use SQLAlchemy and GeoAlchemy to retrieve data from postgis into Python data structures. You will need to understand postgis, SQLAlchemy, GeoAlchemy and Python. 6. Your application can then convert those Python data structures into GeoJSON. You will need to understand GeoJSON. The SQLAlchemy mailing list can help you with exactly one part of this (step 5). SQLAlchemy (and GeoAlchemy) is perfectly capable of querying multiple tables and retrieving results. But how you accept the HTTP request, and how you pass the results back, are completely outside the scope of this list and I'm afraid you are unlikely to find much help here with it. Sorry I can't be more help, Simon -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
RE: [sqlalchemy] live access to postgis database to use in ExtJS, OpenLayers, etc
thanks but I want to use that live access to search at first through ExtJS/GeoExtJS/OpenLayers and through them there is only a url available (protocol HTTP), I also need to get the data as GeoJSON, so I think GeoAlchemy might not be the right solution, I think. If I'm wrong, please I'd love some points about it, thanks. > Subject: Re: [sqlalchemy] live access to postgis database to use in ExtJS, > OpenLayers, etc > From: mike...@zzzcomputing.com > Date: Mon, 1 Oct 2012 17:57:50 -0400 > To: sqlalchemy@googlegroups.com > > take a look at GeoAlchemy: > > http://www.geoalchemy.org/ > > there's a new release upcoming for SQLAlchemy 0.8 that will be vastly > improved. > > > On Oct 1, 2012, at 5:48 PM, Gery Herbozo wrote: > > > One general question, is it possible to create a live access to a > > postgis database using sqlalchemy? the idea is to search records in > > several tables. thanks in advance, regards > > > > -- > > You received this message because you are subscribed to the Google Groups > > "sqlalchemy" group. > > To post to this group, send email to sqlalchemy@googlegroups.com. > > To unsubscribe from this group, send email to > > sqlalchemy+unsubscr...@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/sqlalchemy?hl=en. > > > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalchemy@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
Re: [sqlalchemy] live access to postgis database to use in ExtJS, OpenLayers, etc
take a look at GeoAlchemy: http://www.geoalchemy.org/ there's a new release upcoming for SQLAlchemy 0.8 that will be vastly improved. On Oct 1, 2012, at 5:48 PM, Gery Herbozo wrote: > One general question, is it possible to create a live access to a > postgis database using sqlalchemy? the idea is to search records in > several tables. thanks in advance, regards > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalchemy@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.