Import shape file into postgis? [closed] - shapefile

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I can find multiple tutorials that show how to import shapefiles to postgis via pgAdmin-3. But pgAdmin-3 is no longer supported.
How to do this with pgAdmin-4?

Disclaimer: I know this isn't a valid answer, but I don't have the reputation to comment.
I'd strongly recommend QGIS for this. The import dialog that comes with the Database Manager is rather great. First load the shapefile into QGIS and add a new connection via the "Add PostGIS Layers" button (elephant icon) on the left > "New". Then go to Database > DB Manager > DB Manager, select the newly created connection and open the import dialog (down arrow icon).
If you're into command line tools try ogr2ogr (http://www.bostongis.com/PrinterFriendly.aspx?content_name=ogr_cheatsheet)

I just found this. It works perfectly:
"C:\Program Files\PostgreSQL\9.6\bin\postgisgui\shp2pgsql-gui.exe"

If you have a relatively simple shape, another approach is to use tools that can convert SHP to WKT (e.g. QGIS, or this website). WKT is the Well-known text representation of geometry used in PostGis and you can simply copy this text into an SQL Query in PGAdmin IV etc., for example:
SELECT *
FROM public.geom_table
WHERE column_latlng
# -- contained by
POLYGON((-6.6796875 39.111328125, -29.1796875 20.478515625, -32.6953125 -10.810546875, 12.65625 -24.873046875, 32.34375 1.142578125, 21.26953125 31.201171875, 17.75390625 38.759765625, -6.6796875 39.111328125))

Another option (for MacOS) is to download the Opengeo Suite 4.8 from here http://mac.softpedia.com/get/Developer-Tools/OpenGeo-Suite.shtml.
Then only pull the PostGIS Utilities to your applications folder. You can then delete the pgAdminIII App and just use the pgShapeLoader. Works with pgAdmin4 too.
After that, follow the instructions from this Boundless Tutorial:
http://workshops.boundlessgeo.com/postgis-intro/loading_data.html
I don't know if or how this is working for Windows.
I am running postgres 10.4 with pgAdmin4 on MacOS 10.13.

You can easily import and export shapefile using build in PostGIS tool "PostGIS shapefile and DBF loader exporter" or you can use command prompt to load it.
the related video for import and export shapefile is here:
https://www.youtube.com/watch?v=cgl6-FmpOVo #cmd to load shapefile
https://www.youtube.com/watch?v=1L7QGFlAZq4 #load directly from build in PostGIS tool

Related

How an I get example about CATIA CAA C++ Framework? [duplicate]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I need to start working in CATIA CAA and I am looking for an online introductory course. From a previous post, there doesn't seem to be much available .
All I found is the quite messy documentation which I started digging from:
CATIA_INSTALLATION_DIR/CAADoc/Doc/online/CAADocUseCases/CAADocRunSample.htm
Any hint?
Unfortunately, like many proprietary APIs, it only comes with the software editor examples and documentation and lacks online community to help you getting started...
For CAA, we call the API documentation the Encyclopaedia. The entry point (for V5-6) is rather CATIA_INSTALLATION_DIR/CAADoc/Doc/online/CAACenV5Default.htm
Now there are many aspects you can work using CAA, almost all of them : from data model customization (Object Specs Modeler also called "Features") to visualization through all aspects of geometry and topology. Main CATIA workbenches provide their own layer of APIs (Part Design, Assembly, etc.)
Now to get ready, you will need a Visual Studio (2008 for example if you are working between R20 and R24) on top of which you will install the ENOVIA STUDIO which is basically a set of addins within visual, that will allow you to create, check, test and compile source and resources.
If after install you do not have anything popin up at VS launch, quit it and go to ENOVIA_STUDIO_INSTALLATION_DIR/intel_a/code/bin and launch CATVBTSetup.
You should have a checkbox with visual studio 2008 (if that's the version you need.) Check it and click Install. It should register the right stuff and pop up a blue CAA tips dialog box at next VS launch.
Once there, take a look within CATIA_INSTALLATION_DIR/CAADoc : all the directories ending with .edu are working code frameworks (a framework is the highest container for a group of functionnaly related objects in CAA) covering all examples for the encyclopaedia. You will find a lot more actually, since a good chunk of code often talks a lot more than a tutorial or technical article.
To try out this code (and your ENOVIA STUDIO installation by the way), you can create a directory MYWORKSPACE where you can put the frameworks that interest you (all of them if you want :D )
Now go to VS, File->Open CAA Workspace. Browse to your MYWORKSPACE directory. Pick up a "level" (matching the CATIA release you are working with) and click OK. ENOVIA STUDIO Addin (ES) will create the VS metadata so that you get all Frameworks and modules (framework's code sub-components) as projects within the solution explorer on the left.
Now go to CAAV5 Workspace-->Locate Prerequisite Workspaces and Add the CATIA_INSTALLATION_DIR (where you should have both CATIA and CAA API installed)
Now do Build-->mkmk. check update and debug. Add -jobs 4 in Other Options (so that the build gets faster)
Last but not least, update the runtime view (meaning that ES will copy the resources of each framework in your workspace in the intel_a/win_b64 of you workspace which will be read by CATIA at runtime to find icons, interface implementation binding, etc.)
You can execute CATIA now (if you want to go interactive) by Ctrl+F5. If it does not start, go to the project in bold characters in the Solution Explorer on the left. Right click. Properties. In the tree select Debug and in the Command field navigate to MYWORKSPACE\intel_a (or win_b64)\code\bin\cnext.exe.
Last but not least, ask your questions here, it is way time that CAA community benefits from SO power :)

create PDF with django using python 3 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I want to creat a pdf file with django. But I use python 3. Is there already a libary supportign python3?
I found reportlab, pisa, html2py... but I think none support python 3.
I hope something like html2py is available.
EDIT: I just came across Django Easy PDF which is Python 3 compatible and may be more useful:
https://github.com/nigma/django-easy-pdf
Note, however, that as of writing this xhtml2pdf which is a dependency of Django Easy PDF only supports Python 3 if you install the latest beta version with:
pip install --pre xhtml2pdf
WeasyPrint is Python 3 compatible:
http://weasyprint.org/
It's a great library and is easy enough to integrate with Django. Here's a blog post with some suggestions:
http://ampad.de/blog/generating-pdfs-django/
I would rather go for a stack described here using:
wkhtmltopdf (obtained via apt-get) (info: https://wkhtmltopdf.org/)
pip install pdfkit (info: https://pypi.python.org/pypi/pdfkit)

Any latex web services with an API? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Is there a web service API that takes this type of a latex http-request:
http://some_web_service/texfile?texfile=
\new\documentclass[12pt]{article}
\begin{document}
bla
\end{document}
and returns:
bla.pdf
the Online LaTeX Equation Editor is perfect for this.
EG:
uses the following markup:
![equation using Online Equation Editor]
(https://latex.codecogs.com/gif.latex?x&space;=&space;\frac{4}{5}+\pi\Omega\int_{2\pi}^{\infty}{5\left\(\frac{\tau+3}{2}\right\)d\omega})
note that you will need to escape parentheses with a backslash, eg: \left\( stuff \right\)
If you look through the editor API documentation you might figure out that you can change the format from gif to png by changing the api url endpoint from /gif.latex to /png.latex.
There's also options to set a white background by using \bg_white:
![equation using Online Equation Editor]
(https://latex.codecogs.com/gif.latex?\bg_white&space;x&space;=&space;\frac{4}{5}+\pi\Omega\int_{2\pi}^{\infty}{5\left\(\frac{\tau+3}{2}\right\)d\omega})
See also this meta.stackexchange answer and this tex.stackexchange answer. I'm sure there are many more answers that point to this tool and implement it in different ways. IE: instead of using the url to generate a gif or png using markdown notation, or you could use html markup and bypass markdown or you could just drag the image over to your post.
I'm looking for the same thing and Latex Online seems to be the closest thing to what we need.
You just need to setup the server by yourself.
EDIT
I've written my own little Sinatra app for this: https://github.com/codegestalt/sinatratex
ScribTeX has a CLSI API, you can send CLSI requests from any platform to compile LaTeX.
I blogged some time ago about this along with a CLSI client written in F#.
The Common LaTeX Service Interface (CLSI) is a web service interface and implementation that exposes common LaTeX related capabilities (such as compiling LaTeX documents to different formats):
http://code.google.com/p/common-latex-service-interface/
(This interface is one of the ways that latexlab.org can compile latex)
Fundamentally, this shouldn't be any different than a build server like you see for lots of open source projects (along the lines of Koji for example). Ultimately, you would just hook into pdflatex instead of gcc.
Were you to be able to install software on your local server this wouldn't be too hard. Some combination of Perl / TT / latexmk along with a LaTeX system (e.g. TeXLive or MiKTeX).
I don't know about latexlab mentioned above. The closest thing I know of is http://www.tlhiv.org/ltxpreview/ , which perhaps you could wrap to do what you need (or even write a howto for your users).
Just for completeness:
GitHub or docker might do the trick.
It's basically a micro service implemented in java/spring boot, which is wrapping pdflatex. Urls are immutable and the pdfs are stored on disk/distributed storage. You'll have to host it on your own though. The code is pretty simple and you're able/allowed to customize it to your needs. See the "Scaling the service" section in readme for more details about setting up a production environment.

Export HTML to PDF (C++, Windows) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 11 months ago.
Improve this question
I am looking for a redistributable component to convert HTML to PDF.
I would - at the moment - like to avoid using a "PDF printer", as this requires a printer installation and some user "playing around" in the printers panel might break that feature.
The HTML is available in a Browser control or as external file. The HTML is normally fairly simple, but customers can create their own templates, so a "good range" of HTML should be supported.
Should be accessible for an automated process from C++ - DLL / COM / external executable with command line support are all fine.
Commercial is fine, but in the thousands is not an option right now.
So, which components do you know or can you recommend?
PDFCreator can function as a virtual printer but it's also usable via COM. The default setup even includes COM examples.
You can check the COM samples in the SourceForge SVN repository right here: http://pdfcreator.svn.sourceforge.net/viewvc/pdfcreator/trunk/COM/
If you have Microsoft Word installed, I guess you could automate the whole process using the "save as pdf" plugin that can be downloaded from the Microsoft Office Site.
You would automate word then open the HTML document inside word, then output as PDF. Might be worth a shot, if you're developing in a Microsoft Environment.
You might want to have a look at PDFReactor

Where can I get Toad syntax coloring schemes? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am a big fan of the light colors on a dark background color scheme for programming - which is unfortunately not what Quest's Toad comes with by default.
I notice that it is possible to export and import settings under the language management window, and I know that Toad has a large level of community involvement. So I assume there must be some location where people are posting their custom coloring schemes. However, in part because I don't know what the Toad guys call them (skins? colorization? themes?) and in part because its so hard to Google Toad +skins I cannot for the life of me find them.
Does anyone know if there is such a place so I don't have to set the colors by hand?
UPDATED ENTIRELY:
What's the official name?
The file extension (.dvtcolortheme) suggests "Color Theme" or "DWT Color Theme" are the official names. Most users on Toad forums seem to use the same terminology.
Where are they shared?
There does not seem to be a dedicated site for sharing color themes. However, there were a couple forums on ToadWorld, and ToadForOracle where folks were talking about swapping these color theme files. I would suggest hopping on the forum and asking if others have files to share or know of any repository sites.
Available Color Themes
* Nocturnal theme on GitHub: https://github.com/grng/Nocturnal-Toad-Color-Scheme
* A nice dark-background theme: http://toadfororacle.com/thread.jspa?messageID=93203
Rolling-your-own
I know you did not want to create your own, but it looks a lot easier than either of us expected. The .dwtcolortheme settings file is just XML.
I suggest visiting http://studiostyl.es/ - as it's a large repository of Visual Studio themes. Find a thumbnail you like, take a screen shot, and use a color picker to capture the values. Plop them in your XML settings file and you are ready to go.
Go to View -> Toad Options. Click Editor -> Behavior. There is a button called Syntax Highlighting. On the Highlighting Tab (opens by default) is a list of styles, clicking on the style will show the options selected for that style...
For example in my setup (which is my install default), Reserved Words are blue, Comments green, Strings Red, etc.
Scroll through and you'll see the options, and you can change as necessary for your needs.
The right file for new versions of TOAD is EditorLexers.xml.
For version 12.9 is here
C:\Users\%username%\AppData\Roaming\Dell\Toad for Oracle\12.9\User Files
instead for version 12.11 is here
C:\Users\%username%\AppData\Roaming\Quest Software\Toad for Oracle\12.11\User Files
Here you can download my dark theme
Enjoy!
Update: it works also in version 13.0.
I have created a schema similar to Visual Studio 2017 dark theme
You can download it from: EditorLexers.xml
You need to replace the file located at:
C:\Users\[YOUR_USER]\AppData\Roaming\Quest Software\Toad for Oracle\13.1\User Files