Wednesday, October 30, 2019

Re: django.contrib.gis for Windows 10

Hi.

First postgis should bring all necessary libs since it uses very same geospatial libs as osgeo. 

Very important thing is to make sure that if you have 32bit libs you use 32bit python and same with 64bits. You just can't mix libs with different bit sizes.

In linux this is much easier since it makes way harder to mix bit sizes.

But like many others having native geospatial in windows is a pain. Some of my colleagues have been doing that since geodjango has even existed.

to 13. kesäk. 2019 klo 21.24 Thanasis <th.chousiadas@gmail.com> kirjoitti:
Hello.
I want to use the GeoDjango application. I begun with the tutorial GIS Tutorial. I installed properly the PostgreSQL and PostGis for Windows 10. In addition, I follow the steps and I installed the OSGeo4W in order to get the geospartial libraries. I foolowed the steps in order to create the environment variables GDA L_DATA and PROJ_LIB. So, I continued with the tutorial https://docs.djangoproject.com/en/2.2/ref/contrib/gis/tutorial/#use-ogrinfo-to-examine-spatial-data which this command works properly. I make a geographic model and try to make a migration in the database. Although, I get a big traceback

Traceback (most recent call last):
 
File "manage.py", line 21, in <module>
    main
()
 
File "manage.py", line 17, in main
    execute_from_command_line
(sys.argv)
 
File "C:\Users\examples\vent\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
    utility
.execute()
 
File "C:\Users\examples\vent\lib\site-packages\django\core\management\__init__.py", line 357, in execute
    django
.setup()
 
File "C:\Users\examples\vent\lib\site-packages\django\__init__.py", line 24, in setup
    apps
.populate(settings.INSTALLED_APPS)
 
File "C:\Users\examples\vent\lib\site-packages\django\apps\registry.py", line 122, in populate
    app_config
.ready()
 
File "C:\Users\examples\vent\lib\site-packages\django\contrib\admin\apps.py", line 24, in ready
   
self.module.autodiscover()
 
File "C:\Users\examples\vent\lib\site-packages\django\contrib\admin\__init__.py", line 26, in autodiscover
    autodiscover_modules
('admin', register_to=site)
 
File "C:\Users\examples\vent\lib\site-packages\django\utils\module_loading.py", line 47, in autodiscover_modules
    import_module
('%s.%s' % (app_config.name, module_to_search))
 
File "C:\Users\examples\vent\lib\importlib\__init__.py", line 127, in import_module
   
return _bootstrap._gcd_import(name[level:], package, level)
 
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
 
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
 
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
 
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
 
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
 
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
 
File "C:\Users\examples\vent\lib\site-packages\django\contrib\gis\admin\__init__.py", line 5, in <module>
   
from django.contrib.gis.admin.options import GeoModelAdmin, OSMGeoAdmin
 
File "C:\Users\examples\vent\lib\site-packages\django\contrib\gis\admin\options.py", line 2, in <module>
   
from django.contrib.gis.admin.widgets import OpenLayersWidget
 
File "C:\Users\examples\vent\lib\site-packages\django\contrib\gis\admin\widgets.py", line 3, in <module>
   
from django.contrib.gis.gdal import GDALException
 
File "C:\Users\examples\vent\lib\site-packages\django\contrib\gis\gdal\__init__.py", line 28, in <module>
   
from django.contrib.gis.gdal.datasource import DataSource
 
File "C:\Users\examples\vent\lib\site-packages\django\contrib\gis\gdal\datasource.py", line 39, in <module>
   
from django.contrib.gis.gdal.driver import Driver
 
File "C:\Users\examples\vent\lib\site-packages\django\contrib\gis\gdal\driver.py", line 5, in <module>
   
from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
 
File "C:\Users\examples\vent\lib\site-packages\django\contrib\gis\gdal\prototypes\ds.py", line 9, in <module>
   
from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal
 
File "C:\Users\examples\vent\lib\site-packages\django\contrib\gis\gdal\libgdal.py", line 47, in <module>
    lgdal
= CDLL(lib_path)
 
File "c:\program files (x86)\python37-32\Lib\ctypes\__init__.py", line 356, in __init__
   
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 applicationEnter code here...


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b30c87ac-00d0-4966-a43a-c60533ccec49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHn91ofb5o42SFuQx%3DMocvvRtz%2BWdopkiY-PoBvJeYB3tHLVcg%40mail.gmail.com.

No comments:

Post a Comment