vDataFrame.to_shp

In [ ]:
vDataFrame.to_shp(name: str,
                  path: str = '', 
                  usecols: list = [],
                  overwrite: bool = True,
                  shape: str = "Polygon",)

Creates a SHP file of the current vDataFrame relation. These files are exported to the Vertica database.

Parameters

Name Type Optional Description
name
str
Name of the SHP file.
path
str
Absolute path where the SHP file will be created.
usecols
list
vcolumns to select from the final vDataFrame relation. If empty, all the vcolumns will be selected.
overwrite
bool
If set to True, the function will overwrite the index if an index exists.
shape
str
One of the following spatial classes:
  • Point, Polygon, Linestring, Multipoint, Multipolygon, Multilinestring.
Polygons and Multipolygons always have a clockwise orientation.

Returns

vDataFrame : self

Example

In [9]:
from verticapy.datasets import load_cities
cities = load_cities()
display(cities)
Abc
city
Varchar(82)
🌎
Geometry(1048576)
1Abidjan
2Abu Dhabi
3Abuja
4Accra
5Addis Ababa
6Algiers
7Amman
8Amsterdam
9Andorra
10Ankara
11Antananarivo
12Apia
13Ashgabat
14Asmara
15Astana
16Asuncion
17Athens
18Baghdad
19Baku
20Bamako
21Bandar Seri Begawan
22Bangkok
23Bangui
24Banjul
25Basseterre
26Beijing
27Beirut
28Belgrade
29Belmopan
30Berlin
31Bern
32Bishkek
33Bissau
34Bloemfontein
35Bogota
36Brasilia
37Bratislava
38Brazzaville
39Bridgetown
40Brussels
41Bucharest
42Budapest
43Buenos Aires
44Bujumbura
45Cairo
46Canberra
47Cape Town
48Caracas
49Castries
50Chisinau
51Colombo
52Conakry
53Cotonou
54Dakar
55Damascus
56Dar es Salaam
57Dhaka
58Dili
59Djibouti
60Doha
61Dublin
62Dushanbe
63Freetown
64Funafuti
65Gaborone
66Georgetown
67Guatemala
68Hanoi
69Harare
70Hargeysa
71Havana
72Helsinki
73Honiara
74Islamabad
75Jakarta
76Jerusalem
77Johannesburg
78Juba
79Kabul
80Kampala
81Kathmandu
82Khartoum
83Kiev
84Kigali
85Kingston
86Kingstown
87Kinshasa
88Kuala Lumpur
89Kuwait
90KĂžbenhavn
91La Paz
92Libreville
93Lilongwe
94Lima
95Lisbon
96Ljubljana
97Lome
98London
99Luanda
100Lusaka
Rows: 1-100 | Columns: 2
In [12]:
# Creating the SHP file of the current vDataFrame
# A folder will be created
cities.to_shp("cities", 
              "/home/dbadmin/",
              shape = "Point")